Improve sync failure diagnostics - #162
Conversation
Record privacy-safe structured details for failed refreshes while keeping expected network noise filtered elsewhere. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e934353b-4a22-417e-bfaa-51592bff9e24
There was a problem hiding this comment.
🟡 Changes recommended
The updated finishFailedSync introduces defaulted optional parameters that can silently disable diagnostics and conflict with the repo’s explicit-arguments convention.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves Play Store sync failure diagnostics so real scheduled refresh failures become reliably reportable (with a traceable sync ID, UTC timing, stage, and sanitized cause chain) while reducing sensitive/verbose logging in normal flows.
Changes:
- Introduces
SyncFailureException/SyncFailureStageand propagates the underlying stack trace while sanitizing messages to avoid leaking raw exception text or identifiers. - Updates
UpdateCheckto record and log structured failure diagnostics for session initialization and update-check stages, plus reduces log verbosity around app identifiers. - Updates
CrashlyticsExceptionFilter+ unit tests to ensure explicit sync failures are not filtered as generic network noise.
File summaries
| File | Description |
|---|---|
| app/src/test/java/com/anod/appwatcher/CrashlyticsExceptionFilterTest.kt | Adds coverage asserting sync failures are reported (even for network root causes) and that diagnostics are sanitized. |
| app/src/main/java/com/anod/appwatcher/sync/UpdateCheck.kt | Adds structured sync failure diagnostics (SyncFailureException, stage tracking) and removes sensitive identifiers from logs. |
| app/src/main/java/com/anod/appwatcher/CrashlyticsExceptionFilter.kt | Ensures SyncFailureException is always reported (not ignored as network noise). |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Split diagnostic and non-diagnostic completion so call sites cannot silently omit failure context. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e934353b-4a22-417e-bfaa-51592bff9e24
There was a problem hiding this comment.
🟢 Approval recommended
The changes are self-contained, add targeted test coverage for the new diagnostics behavior, and improve privacy/signal in sync failure reporting without introducing risky control-flow changes.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
Summary
Validation
./gradlew :app:testDebugUnitTest --tests "com.anod.appwatcher.CrashlyticsExceptionFilterTest" --tests "com.anod.appwatcher.sync.UpdateCheckVersionRollbackTest"./gradlew ktlintCheck