Repository navigation
fix(imessage): surface recovery cursor startup failures - #175442
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e38aec936f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return null; | ||
| const store = openRecoveryCursorStore(); | ||
| const key = recoveryCursorStoreKey(accountId, dbIdentity); | ||
| const value = await store.lookup(key); |
There was a problem hiding this comment.
Skip recovery cursor reads while legacy catchup owns replay
With channels.imessage.catchup.enabled: true, monitor-provider.ts:300-311 discards this recovery cursor and the compatibility catchup store owns replay, but this newly uncaught lookup now aborts account startup when only the imessage.recovery-cursor entry is corrupt or otherwise unreadable. That turns irrelevant state damage into a channel outage for a documented retained configuration; skip loading this cursor in catchup mode, or preserve best-effort handling there while keeping fail-closed behavior for normal recovery.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
|
Codex review: blocked before merge. What this changesPropagate recovery-cursor startup failures and bypass the unused normal cursor when compatibility catchup owns replay. Example: Saved progress is row 4990, the Messages watermark is 5000, and reading saved progress fails.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a current silent-recovery failure, and the earlier compatibility-catchup finding is resolved; no new actionable code findings were identified. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe iMessage monitor loads persisted account-and-database recovery progress before starting the imsg watcher, then journals inbound rows through durable ingress before advancing progress. flowchart TD
A[Account startup] --> B[Replay mode]
B --> C[Normal recovery cursor]
B --> D[Compatibility catchup cursor]
C --> E[imsg watcher]
D --> E
E --> F[Durable ingress]
F --> G[Agent dispatch]
Technical reviewBest possible solution: Retain the focused startup-error propagation and compatibility-catchup bypass while preserving the existing replay and persistence owners. Do we have a high-confidence way to reproduce the issue? Current-main source shows a failed cursor read returning null and startup choosing the Messages watermark; the added registered-startup regressions encode that path, but no reproduction was executed during this read-only review. Is this the best way to solve the issue? Removing the catch-to-null behavior fixes the incorrect first-start classification at its owner without changing replay limits, deduplication, stored shapes, or ordinary best-effort writes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c7640b580605. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -11, Tests +75, Docs +2. Total +66 across 7 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 17, 2026, 7:53 AM ET / 11:53 UTC (Revision 3). |
|
Addressed the compatibility-mode finding in 04b1796: the monitor no longer loads normal recovery state when compatibility catchup owns replay. Added a registered account-start regression requiring catchup startup to succeed when that unused recovery store is unavailable, and removed the now-test-only migration-disable option. Normal recovery still fails visibly on authoritative read failure. Independent full-delta review found no actionable P0–P2 issues. Prior-head CI is not repaired-head proof; exact repaired-head CI remains the gate. Local runtime proof could not run without the prohibited broad worker build; the body records that gap and the unchanged local dependency/suppression failures. The pre-existing consume-before-adoption migration atomicity gap is explicitly recorded, not claimed fixed. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
The seven runtime failures on 04b1796 are owned fixture integration failures, not inherited CI:
All registered startup read-failure/catchup-bypass regressions and cursor persistence passed on 04b. Production is unchanged by this fixture followup; independent P0–P2 review found no actionable issue. No mocks, skips, timeout increases or expected-failure exemptions were added. Next exact-head CI is required proof; prior green is not reused. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Exact-head landing evidenceReviewed signed head: Exact-head CI39030132886 has completed successfully. Enumerated all133 check-runs with filter=all and pagination: no failed or unfinished check; selected extension bundle, runtime siblings, production/test types, lint, guards, source contracts, package boundaries, docs and channel critical-quality all succeeded. The auxiliary cancellations117388805482(auto-response) and117388759835(PR context and evidence) have completed same-head successes117388760530 and117388805385 respectively; no runtime suite is cancelled or missing. All three dependency/security/ci-gate commit statuses are successful. Live branch rules require zero approving reviews; none of the seven authored paths matches CODEOWNERS. Remote remains OPEN/MERGEABLE at the reviewed head. Independent full production/test delta review50538 is scoped-clean P0–P2/0.93; fixture-only final delta32016 scoped-clean/0.96. The sole hosted P2 reviewed e38; current monitor-provider explicitly sets recoveryCursorRowid to null when catchupCfg.enabled and never calls loadIMessageRecoveryCursor in that branch. Registered compatibility-start coverage passed hosted CI. Seven owned fixture prerequisite failures on04b were fixed through existing worker routing/healthy runtime, with no assertions, timers, retries, skips or timeouts weakened. They were not attributed to main. No reruns or advancement-only rebase. Local limitations remain disclosed: cold native runtime proof was stopped before assertions when it required prohibited broad compilation; targeted types found unchanged parse5/MCP dependency gaps, and suppression guard13PASS/1FAIL solely unchanged MCP97vs95. These are not relabeled local passes; exact-head hosted runtime/types/lint/guards now pass. No live Messages account, credentials, operator state or external API proof is claimed. Production35add46delete=11netremoved; tests/support/routing107add32delete; docs2add. Normal recovery read failures now stop account startup visibly instead of inventing empty progress. Compatibility catchup retains its own owner. Existing consume-before-adoption-write atomicity gap remains unchanged and separately parked; this PR does not claim atomic migration or alter persisted shapes. Campaign Ending10 authorizes the exact-SHA guarded direct landing fallback after the retained three native pre-intent startup infrastructure failures (Backup36/Canvas37/Google39), plus175442's allocation deadline. Native lock owner d6b39380f5031a418c9c4eeef226cd0ae3963c2f remains preserved; supported lock recovery failed dependency qualification, no shared install/manual ref cleanup. Known task descendants drained; no native merge intent/outcome or uncertain merge write exists. This fallback bypasses broken tooling startup, not CI, reviews, security or enforced policy. Effective token-unset writer steipete and Peter author/committer verified. |
What Problem This Solves
Fixes missed iMessages being skipped after a saved recovery-cursor read fails: the error was treated as a first start, so the watcher could subscribe from the latest database row instead of saved progress.
User Impact
For normal downtime recovery, an unreadable recovery cursor now stops account startup visibly. Resolving the state-store read error and restarting resumes saved progress. Legitimately absent cursors retain first-start behavior. Explicit compatibility catchup retains its own replay cursor and no longer reads the unused normal recovery cursor.
Why This Change Was Made
Remove two catch-to-null startup wrappers and let the existing account-start error owner report failures. Skip normal recovery-cursor loading when compatibility catchup owns replay. Remove the migration-disable option that becomes test-only, preserving migration, database-scoping and rewind assertions and moving compatibility coverage to registered account startup.
Ordinary advance/rewind best-effort writes, original migration ordering, GUID deduplication, replay bounds, persisted shapes and shutdown remain unchanged. The recovery feature and incident-backed stale-backlog fence from #91335 remain intact.
Best-effort tradeoffs accepted
Production delta: 35 added / 46 deleted, 11 net lines removed. Tests/support/routing add 107 lines and remove 32 (75 net added); documentation adds two lines. This is a silent-failure bug fix.
Evidence
Exact final head
5a4201353ec2b6815dbca183945be35d9d3cab92: CI39030132886 succeeded, including the extension bundle, retained runtime siblings, production/test types, lint and guards. All133 check-runs enumerated; auxiliary metadata cancellations have successful same-head successors. No failed or unfinished check and all three required security/dependency/CI statuses successful. The earlier hosted compatibility finding is fixed by skipping normal cursor loading whenever compatibility catchup owns replay.