Repository navigation
fix(ios): stop node retries while the Gateway rate-limits auth - #196796
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: needs maintainer review before merge. What this changesThis PR pauses iOS node reconnects when they encounter the same non-pairing authentication failure already reported by the operator connection. Example: Both iOS connections receive AUTH_RATE_LIMITED from a password-authenticated Gateway.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current iOS retry-control defect with a focused change and no identified correctness findings; the broader linked issue remains only partly addressed. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe iOS app maintains operator and node Gateway connections; NodeAppModel maps their errors into presentation and reconnect control, while the existing connection controller handles explicit recovery. flowchart TD
A[Gateway auth rejection] --> B[Connection problem mapper]
B --> C[NodeAppModel error owner]
C --> D[Reconnect pause flag]
D --> E[Node reconnect loop]
C --> F[Existing recovery banner]
F --> G[Explicit retry controller]
G --> E
Technical reviewBest possible solution: Use the existing reconnect flag to enforce shared non-pairing pauses while preserving pairing ownership and explicit in-app recovery. Do we have a high-confidence way to reproduce the issue? The current-main branch and reconnect-loop control establish the failure path, and the author supplies a concrete simulator reproduction; this read-only review did not independently execute it. Is this the best way to solve the issue? This is the smallest complete repair for the stated retry defect: it restores the existing pause invariant without adding state, changing limiter policy, or disturbing pairing ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c581fe06177a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +18. Total +23 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
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 Reviewed November 10, 2026, 1:37 PM ET / 18:37 UTC. |
|
Merged via squash.
|



What Problem This Solves
Refs #190773 (the
AUTH_RATE_LIMITEDlockout part; the separate missed-tick reconnect cancellation in that issue is not addressed here).When the Gateway locks out auth (
AUTH_RATE_LIMITED), the iOS operator connection stops, but the node connection keeps retrying against the locked Gateway every ~30 s for as long as the app is open. Each attempt is another rejected handshake, which matches the field report (24 node vs ~4 operator rejects per burst).Root cause
NodeAppModel.recordNodeGatewayConnectionErrorhas a branch for a node problem that equals the operator's active problem ("a node cancellation may echo an active operator approval failure"). That branch only updates the displayed status. It never disablesgatewayAutoReconnectEnabled, whichapplyGatewayConnectionProblemdoes for every otherpauseReconnectproblem. So when both roles hit the same rate limit, the node loop'spauseReconnectpath never actually pauses.Change
In that branch, a shared
pauseReconnectproblem that isn't a pairing approval now disables auto-reconnect, the same as the node's own problems. Pairing approvals keep their existing owner-specific handling. The user resumes with Wait and retry, as before.Evidence
Throwaway Gateway on loopback with password auth, the default limiter, and
rateLimit.exemptLoopback=false. Steps: connect the iPhone 17 simulator, lock out the IP with wrong-password attempts, rotate the password, then count the app's rejected handshakes for 120 s.mainTests:
node echo of an operator rate limit stops reconnect attempts(GatewayReconnectErrorRetentionTests) fails onmain(gatewayAutoReconnectEnabledstays true) and passes with the fix.GatewayConnectionControllerTests+GatewayReconnectErrorRetentionTests: 97 pass.Size: +6 production lines (2 of them a comment), +18 test lines.