Repository navigation
fix(mobile): distinguish delayed dial deadlines from unreachable hosts - #31478
Conversation
Classify late connect/handshake callbacks using monotonic elapsed time, retain the existing forced-close/retry path, and supersede earlier direct timeouts in the diagnostic summary. Only report a host version from a live, settled status read; disconnected diagnostics no longer expose a stale cache. Adapted from community PR #24425, with the current framing lifecycle retained. Fixes #18829. Co-authored-by: Wooseong Kim <[email protected]> Co-authored-by: Cursor <[email protected]>
Reuse the connection revival AppState listener to supplement monotonic timing only when the app left the foreground. Native steady clocks can pause during device sleep; foreground wall-clock steps still cannot turn a normal timeout into suspension. Co-authored-by: Wooseong Kim <[email protected]> Co-authored-by: Cursor <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to
|
Finalize wall-minus-monotonic gaps at resume and sample the accumulator at deadline arm. A short inactive period can no longer let a later foreground clock jump misclassify a normal timeout as suspension. Cover the reported regression, mid-background deadlines, repeated segments, and backward clock movement. Co-authored-by: Wooseong Kim <[email protected]> Co-authored-by: Cursor <[email protected]>
Capture the connection timestamp associated with the supplied live host version. If log hydration crosses a reconnect, report the version as unknown rather than attaching the previous connection's version to the new session. Add red/green production-report regressions for reconnect during hydration, disconnected operation creation, and a stable live connection. Co-authored-by: Wooseong Kim <[email protected]> Co-authored-by: Cursor <[email protected]>
…nsion-diagnostics
Current main generalized the failure word to cliTooOld with an agent placeholder, but left Portuguese on codexCliTooOld. Preserve the existing translation while matching the renamed key and interpolation contract. Unblocks the catalog parity check after synchronizing main for #31478.
The current-main queued editor import graph now reads i18n.language while building the agent catalog. Supply the English locale alongside the existing translation stub, matching neighboring fixtures and preserving every assertion. Unblocks the suite-load failure found by full CI for #31478.
ELI5
When a phone puts Orca to sleep, its connection alarm can ring hours late. Orca now says the alarm was delayed and checks the connection again. A normal timeout still reports a connection failure. Reports also stop presenting a saved host version as today's version.
Problem and fix
A connect deadline armed for 12 seconds was delivered 2h44m later and blamed the endpoint. That gap proves late delivery; it cannot establish why JavaScript stopped running or whether the endpoint was reachable. Diagnostics could also display a previously cached host version as current.
Fixes #18829.
suspended-dialwarning: the app may have been suspended and the connection state is unknown. The same forced close and reconnect path runs. Ordinary 12-second connect and 5-second handshake deadlines retain their errors.unknown (not currently connected). If log hydration crosses a connection timestamp change, discard the earlier operation's supplied version rather than attach it to the replacement connection.Reliability and performance
Invariant: deadline evidence must describe what the client observed while retaining the existing socket-close/retry owner; captured host metadata must not cross an observed reconnect. The oracle is the production socket/report behavior under delayed callbacks, clock changes and asynchronous storage.
The adjacent
mobile-relay.endpoint-recoverygate passes. There is no manifest gate specifically for deadline attribution; focused clock/socket/diagnosis regressions provide that oracle, with physical device sleep an explicit coverage gap.The native root provider owns the physical sockets and existing AppState listener. The web-page provider is a bridge client and does not dial. No additional timer, listener, polling, RPC, protocol field, subprocess or startup wait is added. Clock accounting is O(1), and the report follow-up adds synchronous getter reads. Existing cleanup guards and retry ownership remain intact.
Mixed host/client versions retain the existing protocol. Host macOS/Linux/Windows, SSH/WSL, local/daemon terminal ownership, and git/folder workspace behavior are unaffected. Mobile direct/relay contracts are exercised deterministically on macOS; Android and physical Hermes sleep remain gaps.
Verification
TerminalWebView.tsx(TS2769/TS7006), also verified on baseline sources. Exact-head GitHub checks are required before merge.1.4.196becomes unknown while disconnected. Home/background/resume was exercised; the fixture injects the pending socket and late delivery.Visual proof
Actual simulator framebuffer captures, inspected for readable diagnostics, severity and host-version reporting. The footer shows a line from the production copied report; the fixture labels the injected timer condition.
Current-main compatibility
Synchronized main
ec546de75acafter it independently repaired the Portuguese catalog key and queued-editor i18n mock. Retain both upstream versions unchanged, removing these incidental repairs from this PR's final diff. The diagnostics production files are byte-unchanged by this sync. All 128 focused mobile tests and 17 existing queued-editor tests pass after synchronization; the independent reviewer checked both conflict resolutions and catalog parity.Community credit and merge risk
Adapted the deadline-classification idea from @innocarpe's #24425, retained the current direct framing lifecycle, reused the existing AppState listener, and addressed the stale-version half of #18829. Wooseong Kim and Cursor receive commit co-author credit. #24425 is superseded by this PR.
Low merge risk: this corrects diagnostic evidence while preserving connection mechanics. Busy foreground JavaScript and background wall-clock changes can also cause the qualified warning. Physical iPad hours-long suspension/Hermes has not been proved. The narrow captured-version guard uses existing connection timestamps; it does not redesign the unchanged host-status hook's cache ownership or claim to cover an exceptionally batched reconnect that React never observes.