Skip to content

Commit 8a5fd5a

Browse files
committed
fix(ui): keep screens up when their data can't be read
Every screen's state came from stateIn on viewModelScope, which has no exception handler. A Room or DataStore flow that threw while a screen collected it (a dropped table, an unreadable settings file) ended there and closed the app. All 90 of them now go through one screenState helper that logs the error and keeps what the screen last showed, or its initial value when the first read fails. onboardingDone can't stay on its null, which draws a blank surface until settings load, so a failed read there shows the app instead. Two tests added to ViewModelActionFailureTest: a dropped call_log table under totalBlocked, and an unreadable settings file under onboardingDone. IsolatedRepositoryFixture gains an unreadableSettings option for the second one. No existing test was wrong. Both new tests fail without the catches, and a catch that logs and rethrows fails the trailing runTest with UncaughtExceptionsBeforeTest.
1 parent 2dd8969 commit 8a5fd5a

5 files changed

Lines changed: 184 additions & 111 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ All notable changes to CallShield will be documented in this file.
5151
- Spam on the post-call screen now records the block and the report itself, and the home screen widget redraws itself when your lists change. Both used to hand the job to the app's own receiver with a broadcast, which Android 17 QPR2 no longer delivers once the app has left the screen, so the block could have been lost.
5252
- Block area code no longer offers China's +86 410 or +86 413. The newest phone numbering data the offer is built from (libphonenumber 9.0.42) doesn't list them as area codes anymore.
5353
- The app no longer closes as it starts when it can't read whether update checks are on. It skips setting up the weekly check that time and tries again on the next start.
54+
- A database error while a screen is open no longer closes the app either. The screen keeps what it was showing, or its empty state if nothing had loaded yet, and the error is logged. If the app's settings can't be read at all, it opens to the main screen instead of a blank one.
5455

5556
## v1.12.0 (2026-10-09)
5657

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<p align="center">
1313
<a href="https://github.com/SysAdminDoc/CallShield/releases/latest"><img src="https://img.shields.io/github/v/release/SysAdminDoc/CallShield?style=flat-square&color=a6e3a1" alt="Release"></a>
1414
<img src="https://img.shields.io/badge/Spam%20Numbers-51%2C403-f38ba8?style=flat-square" alt="51,403 Numbers">
15-
<img src="https://img.shields.io/badge/JVM%20unit%20tests-2029-94e2d5?style=flat-square" alt="2029 JVM unit tests">
15+
<img src="https://img.shields.io/badge/JVM%20unit%20tests-2031-94e2d5?style=flat-square" alt="2031 JVM unit tests">
1616
<img src="https://img.shields.io/badge/Android-10%2B-89b4fa?style=flat-square" alt="Android 10+">
1717
<img src="https://img.shields.io/badge/License-MIT-cba6f7?style=flat-square" alt="MIT License">
1818
<img src="https://img.shields.io/badge/API%20Keys-None-fab387?style=flat-square" alt="No required API keys">
@@ -592,12 +592,12 @@ RELEASE_KEY_PASSWORD=...
592592
## Testing
593593

594594
```bash
595-
./gradlew testDebugUnitTest # 2029 tests
595+
./gradlew testDebugUnitTest # 2031 tests
596596
./gradlew connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.sysadmindoc.callshield.platform.TargetSdkBehaviorSmokeTest
597597
./gradlew verifyPipelineTests # Cloudflare Worker (node) + data-pipeline and translation checks (python)
598598
```
599599

600-
The suite is **2029 total JVM unit tests**, run with Robolectric wherever a screen, a service or the database is involved.
600+
The suite is **2031 total JVM unit tests**, run with Robolectric wherever a screen, a service or the database is involved.
601601

602602
Two GitHub workflows run without building the app. **Validation** runs the Worker and
603603
pipeline suites on every push except report-only ones (`run-pipeline-tests.ps1 -CorrectnessOnly`),
@@ -634,7 +634,7 @@ language in [issue #7](https://github.com/SysAdminDoc/CallShield/issues/7).
634634
| Community API | Cloudflare Workers |
635635
| URL Safety | Local spam-domain data, with optional PhishTank and OpenPhish |
636636
| Verification | Local Gradle, lint, and release-artifact checks |
637-
| Tests | 2029 JVM unit tests (JUnit) |
637+
| Tests | 2031 JVM unit tests (JUnit) |
638638
| Strings | 1792 string resources and 49 plural groups (translation-ready) |
639639
| Accessibility | 100+ content descriptions, 48dp touch targets |
640640
| Min SDK | 29 (Android 10) |

0 commit comments

Comments
 (0)