Skip to content

Improve sync failure diagnostics - #162

Merged
anod merged 2 commits into
masterfrom
fix/sync-failure-diagnostics
Aug 25, 2026
Merged

Improve sync failure diagnostics#162
anod merged 2 commits into
masterfrom
fix/sync-failure-diagnostics

Conversation

@anod

@anod anod commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • report failed scheduled refreshes with a traceable sync ID, UTC timing, stage, exception classes, HTTP status, and stack location
  • bypass generic network-noise filtering only for an actual failed refresh
  • remove raw exception messages and watched-app identifiers from refresh diagnostics

Validation

  • ./gradlew :app:testDebugUnitTest --tests "com.anod.appwatcher.CrashlyticsExceptionFilterTest" --tests "com.anod.appwatcher.sync.UpdateCheckVersionRollbackTest"
  • ./gradlew ktlintCheck

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
Copilot AI lite review requested due to automatic review settings August 25, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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/SyncFailureStage and propagates the underlying stack trace while sanitizing messages to avoid leaking raw exception text or identifiers.
  • Updates UpdateCheck to 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.

Comment thread app/src/main/java/com/anod/appwatcher/sync/UpdateCheck.kt Outdated
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
Copilot AI review requested due to automatic review settings August 25, 2026 09:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@anod
anod merged commit 21d57fe into master Aug 25, 2026
5 checks passed
@anod
anod deleted the fix/sync-failure-diagnostics branch August 25, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants