fix(android): queue node events until gateway connect#92602
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 6:33 PM ET / 22:33 UTC. Summary PR surface: Other +811. Total +811 across 7 files. Reproducibility: yes. at source level: current main publishes currentConnection before the connect RPC finishes, Android notification forwarding sends through that readiness gate without retry, and the gateway rejects non-connect first requests. I did not run a live Android device or emulator in this read-only review. Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this PR if maintainers accept scoped queued-event recovery and bounded duplicate-avoidance semantics; otherwise keep or split a narrower follow-up for active-notification snapshot replay. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main publishes currentConnection before the connect RPC finishes, Android notification forwarding sends through that readiness gate without retry, and the gateway rejects non-connect first requests. I did not run a live Android device or emulator in this read-only review. Is this the best way to solve the issue? Yes for the queued-node-event race: making GatewaySession expose only ready connections and letting NodeRuntime own bounded notification delivery is the right owner boundary. Full active-notification replay remains a maintainer scope decision rather than a definite patch defect. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 32762dad539d. Label changesLabel justifications:
Evidence reviewedPR surface: Other +811. Total +811 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Branch merged with upstream/main (clean, no conflicts). Fixed deprecated |
|
🦞🧹 I asked ClawSweeper to review this item again. |
27f60c3 to
da4554e
Compare
da4554e to
2229c4d
Compare
|
Land-ready maintainer rewrite at What changed:
Verification:
No before/after screenshot: the failure is transport ordering with no meaningful visual state; the emulator/Gateway transcript is the relevant proof. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Co-authored-by: Ashish Patel <[email protected]>
2229c4d to
129ef0b
Compare
|
Merged via squash.
|
* fix(android): queue notification events until gateway ready Co-authored-by: Ashish Patel <[email protected]> * style(android): format notification gateway changes * style(android): fix gateway resolver formatting * chore(android): sync native i18n inventory --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
Closes #79552.
What Problem This Solves
Android notification forwarding could call
node.eventwhile the WebSocket existed but the Gateway handshake was still incomplete. The Gateway requiresconnectto be the first request, so notification-triggered automations could silently miss events during initial connect and reconnect windows.Why This Change Was Made
GatewaySession.Connectionown its pending RPCs and explicit connecting/ready/closed state; outward RPCs see only a ready connection.This replaces the original reconciliation/parallel-ID approach; it does not replay the device's entire active-notification set after reconnect.
User Impact
Notifications accepted while Android is disconnected or still handshaking are delivered in order after reconnect. The queue is bounded, policy changes purge stale content, and uncertain sends are not replayed as duplicates.
Evidence
node.event, returned success in 186 ms, and no duplicate followed.GatewaySessionInvokeTest,GatewaySessionReconnectTest,NotificationNodeEventOutboxTest, andGatewayBootstrapAuthTest.:app:ktlintMainSourceSetCheck,:app:ktlintTestSourceSetCheck, and:app:assemblePlayDebugpassed.node --import tsx scripts/native-app-i18n.ts checkpassed.tbx_01kwjdyehj5p35mb94ercj82x2: exact-headpnpm check:changedpassed.No screenshot is attached because this is a transport lifecycle fix with no meaningful visual before/after state; the real Gateway transcript is the behavioral proof.