Repository navigation
fix(ios): Gateway password typed in Settings is ignored after onboarding pairing - #198106
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 saves Settings credential edits to the active saved Gateway when no manual host is configured, preserving the other stored credential. Example: After onboarding pairs gateway.example.ts.net:443, enter rotated-password in Settings and tap Reconnect.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current credential-persistence defect, and I found no introduced correctness or security bug; normal CI is still pending. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe iOS Settings form binds credential fields to a Gateway identity, writes through GatewaySettingsStore into Keychain, and reconnects through GatewayConnectionController using that Gateway's saved credentials. flowchart LR
A[Settings credential edit] --> B[Existing field owner]
C[Manual endpoint or active Gateway] --> B
B --> D[GatewaySettingsStore]
D --> E[Keychain credential bundle]
E --> F[Gateway reconnect]
Technical reviewBest possible solution: Land the focused repair through the existing field and persistence owners while keeping the broader connection-state report open. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the nil-target save failure, and the contributor supplies a matching before/after simulator reproduction; I ran no target code. Is this the best way to solve the issue? The smallest complete fix resolves the fallback through the existing registry and loads the existing credential bundle before changing one field, preserving Gateway identity and the untouched credential without new storage or policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7d8875eb5f60. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +36, Tests +32. Total +68 across 3 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 13, 2026, 12:20 AM ET / 05:20 UTC. |
|
Merged via squash.
|
…ing pairing (openclaw#198106) * fix(ios): save the Gateway password for the active gateway after onboarding pairing * fix(ios): load stored credentials before saving an edited field



Related: #182723
What Problem This Solves
Fixes: after pairing iOS from onboarding (setup code or QR), typing the Gateway password in Settings did nothing. The password was never saved, so Reconnect and later launches kept sending the old device token and the app stayed on "Gateway password is out of date".
User Impact
User impact: when the Gateway rejects the saved credentials, typing the correct password in Settings and tapping Reconnect connects. The password is also kept for later launches.
Why This Change Was Made
Settings saved the Gateway Password and Gateway Auth Token fields under the manual-host endpoint. Onboarding pairing never fills the manual host, so the save target was empty and the save was silently skipped (
Fields.persistreturns when the target is nil). The fields still showed the typed text, so it looked saved.Now, when no manual host is set, the fields load from and save to the active saved gateway, the same entry Reconnect connects to. A manual host still wins when one is set, and fields already bound to a gateway are unchanged. Saving writes token and password together, so a new
Fields.editfirst loads the target's stored credentials into unbound fields; typing a password can no longer erase the stored token.Accepted edge (as on
main): after switching gateways from the sidebar while Settings stays open, an edit still saves to the gateway the fields were last bound to, until Settings syncs again on appear or foreground.Evidence
Simulator (iOS 27, isolated local Gateway with password auth): pair from onboarding with a setup code, revoke the device's tokens on the Gateway so the app shows "Gateway password is out of date", type the correct password in Settings → Gateway Password, tap Reconnect, then relaunch.
main(73c6cbf00f9)authProvided=token authReason=password_mismatchclient connected auth=passwordauth=password, app ConnectedThe node role first needs Gateway approval because its device token was revoked ("Additional approval required" on the device). After approval it connects with the password.
Test:
a credential typed after onboarding pairing saves to the active gateway. It fails with the active-gateway fallback removed (the password is not saved) and with the load-before-save step removed (the stored token is erased). It passes with both.RootTabsSourceGuardTestsandGatewayConnectionControllerTests: 98/98.Review: two second-model rounds. Round 1 found the token-erasing write and a test that could not fail; both are fixed. Round 2: ready.