Skip to content

fix(app): export bounded push registration diagnostics - #25873

Merged
aryanorastar merged 2 commits into
mainfrom
codex/push-registration-diagnostics-20261120
Nov 22, 2026
Merged

aryanorastar merged 2 commits into
mainfrom
codex/push-registration-diagnostics-20261120

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Push registration can exhaust its retries without leaving an actionable record in Developer → Share Logs. The registrar's debug output goes only to Talker, so Support cannot distinguish unavailable APNs/FCM, a local ordering write failure, or rejected registration persistence when an account has no push destination.

This change records closed stage/result values and optional HTTP status through the existing opt-in DebugLogManager. It preserves retry, token receipt and auth-generation behavior, suppresses stale-owner failures, and isolates diagnostic-write failures. It records no token, account identifier, timezone value, request/response body or SDK error text, and adds no remote telemetry. HTTP and local ordering logs are admitted only while the same registration attempt is pending under its current auth owner.

Related to #25870. This fixes the diagnostic gap only; it does not establish the cause of the reported missing registration or restore customer push delivery. Keep the issue open for that investigation. The separate disk-full index failure is tracked in #25871.

Validation on 871121c: 26 focused Flutter tests passed, including delayed HTTP acknowledgement after timeout and account switch. Both tests exercise the real registrar, HTTP response handling and temporary export file, with a synthetic transport. Static analysis and all 29 local preflight checks passed. See Mobile App Checks for the full CI suite. Actual background delivery and the affected account remain separate follow-ups.

Failure-Class: FC-typed-failure-collapsed-to-generic

UI-Evidence: none -- No visible UI changes; opt-in diagnostic file events only.

View guided diff Turn on auto-fix

Record missing acquisition/persistence outcomes in the opt-in developer export without token, account or exception payloads. Preserve retry, cached receipt and auth-generation behavior. Related to #25870; this is diagnostic coverage, not a claim of restored push delivery.

Validation: 23 focused registrar/export/admission tests and 138 opt-in spine tests passed; 29 local preflight checks passed. Full component suite and targeted analyzer pending at commit time. Production data and delivery unchanged.

Failure-Class: FC-typed-failure-collapsed-to-generic
@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: well-scoped and privacy-careful diagnostic addition — the production change looks correct and I have no blocking findings. Keeping diagnostics closed-vocabulary, opt-in, and non-gating is exactly the right shape.

Per file:

  • app/lib/services/notifications/fcm_token_registration.dart — logPushRegistration emits only stage/result/http_status and swallows its own failures; _record isolates observer exceptions so diagnostics cannot alter retry or ownership (covered by the observer-throwing test). The stage tracking in _attempt preserves the old early-return semantics while now distinguishing apns/token unavailable, persistence declined, and timeout vs exception; the _current(owner, epoch) guard in the catch gives the stale-owner suppression the docs promise.
  • app/lib/backend/http/api/notifications.dart — behavior parity holds: both rethrow paths propagated before this change too, order == null still returns false, and the only removed line is the Talker Logger.debug, replaced by the closed-vocabulary record. Note a failed persist that returns non-200 now emits two records (persistence + http stage) — useful signal, just be aware Support will see both.
  • app/test/unit/fcm_token_registration_test.dart — good coverage: exactly one accepted record, cached-receipt suppression, retry/exhausted sequence, missing-FCM vs missing-APNs distinction, observer-failure isolation, declined-then-accepted recovery.
  • app/test/unit/debug_log_manager_test.dart — the integration test asserting no private- strings, no StateError text, and only the allowlisted row keys is exactly the right privacy test for this feature.
  • app/docs/task-export-and-push-registration.md — claims match the code as far as I can verify; the two unchecked verification boxes (component suite/preflight, post-release delivery evidence) are consistent with draft status.
  • app/changelog/unreleased/20261120-push-registration-diagnostics.json — kind:none with an accurate reason; correct for an opt-in, diagnostics-only change.

Minor, non-blocking: session/unavailable is recorded on every refresh with no signed-in owner, without dedup — repeated lifecycle wakes could add noise to the (opt-in) export. Worth suppressing repeats if it turns out noisy in practice.

Security: no token, account identifier, timezone value, body, or SDK error text reaches the export (verified by the schema assertions); records are device-local and the export stays opt-in — no new remote telemetry, permissions, or delivery-behavior change.

USER IMPACT: none — push delivery, permissions, and retries are unchanged; users who enable the developer log export will see new diagnostic lines.

Before marking ready: tick the two unchecked verification items, and note the full-suite timeout you hit (capture_recovery_replay_scenarios_test.dart) reads as harness flake rather than a regression — the isolated rerun pass is reasonable evidence, but the final CI run should be green.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added the flutter flutter work label Nov 20, 2026
@aryanorastar
aryanorastar marked this pull request as ready for review November 21, 2026 06:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T17:08:29.158439Z 871121c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level Git-on-my-level added the positive-signal Automation verified a genuine fix/quality contribution label Nov 21, 2026
Require an active persistence wait and current auth owner when recording local ordering or HTTP outcomes. Cover a delayed response after timeout and after an account switch through the real export queue.

Failure-Class: FC-typed-failure-collapsed-to-generic
@aryanorastar
aryanorastar marked this pull request as draft November 22, 2026 16:29
@aryanorastar
aryanorastar marked this pull request as ready for review November 22, 2026 17:04
@aryanorastar
aryanorastar merged commit fbd2478 into main Nov 22, 2026
55 checks passed
@aryanorastar
aryanorastar deleted the codex/push-registration-diagnostics-20261120 branch November 22, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants