Lookup path can't crash the app; persist crash reports for off-device reading
The wave-7 build crashed on the first scan on a real phone and never reproduced.
A live off-device run of the real lookup (93546ed) found nothing wrong with the
parse/merge code. What it did find: nothing on that path was exception-safe. Both
clients caught only IOException, classify caught only serialization errors, and
ScanViewModel.runLookup had no guard at all, so any other throwable — platform
TLS, an OkHttp internal, anything this JVM can't reproduce — killed the process
instead of surfacing on the scan sheet.
- OpenLibraryClient and GoogleBooksClient catch Throwable -> new
FailureKind.UNEXPECTED, never retried. The reason names the exception CLASS
only; its message can carry the request URL and therefore the API key.
- ScanViewModel.runLookup guards the same way, which also covers its Room call.
- CancellationException is rethrown ahead of every catch-all: dismissing the
sheet cancels the lookup, and that must not render as a failure.
- diagnostics.CrashReporter persists uncaught stack traces and chains to the
previously installed handler in a finally, so the process still dies normally
even if writing the report fails.
- Settings gains a Diagnostics section: last crash, View trace, Share.
Not fixed, flagged by the worker: performSave/performSaveManualEntry make the
same unguarded Room calls on the save path.
Verified by the orchestrator: assembleDebug (--rerun-tasks) exit 0;
testDebugUnitTest exit 0, 205 tests (was 190), 2 skipped, 0 failures, counted
from TEST-*.xml; verifyPaparazziDebug exit 0; 0 "always 'false'" warnings.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AQb3d68LqWD4EdND3C8jkD
This commit is contained in:
1 parent
1295d88d6e
commit
34097269c9
23 files changed
+681
-26
No files matched your search
@@ -0,0 +1 @@
|
||||
c0db9a19-d387-460b-899c-ea5995ce1ead
|
||||
Reference in new issue
Block a user