Skip to content

fix(ios): Gateway password typed in Settings is ignored after onboarding pairing - #198106

Merged
obviyus merged 2 commits into
mainfrom
fix/ios-gateway-credentials-active-target
Nov 13, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/ios-gateway-credentials-active-target

Conversation

@obviyus

@obviyus obviyus commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

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.persist returns 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.edit first 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.

Build Gateway log after Reconnect After relaunch
main (73c6cbf00f9) operator and node: authProvided=token authReason=password_mismatch same; still "Gateway password is out of date"
this PR operator: client connected auth=password operator and node auth=password, app Connected

The 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. RootTabsSourceGuardTests and GatewayConnectionControllerTests: 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.

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Simulator before/after (iOS 27, isolated password-auth Gateway, app paired from onboarding, device tokens revoked, correct password typed in Settings, then Reconnect).

Correct password typed into Settings → Gateway Password

Before (main): after Reconnect still Gateway password is out of date

After: connected with the password

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The empty manual host leaves no save target, so Reconnect continues using the previous credentials.
  • After: The password is saved for the active Gateway, its existing token is preserved, and Reconnect can authenticate.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct repair with supplied product-path proof and a meaningful stored-credential regression; the linked issue is only partially addressed.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The supplied iOS 27 simulator scenario exercises onboarding pairing against an isolated password-auth Gateway, revoked device tokens, Settings password entry, Reconnect, node approval, and relaunch; inspected screenshots and the reported Gateway output support successful password authentication afterward.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: A correctly entered Gateway password appears saved but is ignored after onboarding pairing, leaving the app unable to reconnect.
Reason: The maintainer-authored direction restores an existing recovery contract with a focused change; it appropriately addresses only part of #182723.

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
Reviewed head: a85b467804cba574a287f594594b9d65b93c2f7a

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Settings credential loading and fixture isolation keeps the original intent (0eb99b3: Keep screenshot and Apple Review fixtures isolated from installed users' saved Gateways and credentials.)
  • Credential field ownership and persistence keeps the original intent (f787b03: Consolidate Settings and onboarding field transitions while retaining exact Gateway ownership and GatewaySettingsStore as the durable owner.)
  • Credential binding changes intended behavior with a stated reason (17803f3: Reuse existing credential-edit decision owners without changing persisted shapes or native behavior.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f787b03 adds apps/ios/Sources/Gateway/GatewayConnectionController+ManualAuth.swift:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f787b03fbe26; files: apps/ios/Sources/Gateway/GatewayConnectionController+ManualAuth.swift)

PR surface

Source +36, Tests +32. Total +68 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 42 6 +36
Tests 1 32 0 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 74 6 +68

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P1: The current defect breaks the advertised in-app password recovery path and leaves paired iOS users unable to reconnect with a correctly entered password.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P1: The current defect breaks the advertised in-app password recovery path and leaves paired iOS users unable to reconnect with a correctly entered password.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 13, 2026, 12:20 AM ET / 05:20 UTC.

@obviyus
obviyus merged commit 3ac68cb into main Nov 13, 2026
94 checks passed
@obviyus
obviyus deleted the fix/ios-gateway-credentials-active-target branch November 13, 2026 05:33
@obviyus

obviyus commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant