Repository navigation
fix(ios): stop persisting pasted setup codes - #197049
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 keeps pasted iOS Gateway setup codes in memory, clears them on onboarding reset, and removes previously persisted codes at launch. Example: Paste the synthetic value review-demo into Settings → Gateway, then terminate and relaunch the app.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes credential-bearing input persistence that remains on main, and the prior reset finding is resolved; no actionable patch defects remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherNative iOS Gateway Settings accepts setup input and passes parsed credentials to the existing connection owner; app startup removes legacy input storage and onboarding resets clear transient input. flowchart TD
A[Pasted setup code] --> B[Settings memory state]
B --> C[Existing setup parser]
C --> D[Gateway connection owner]
E[Onboarding reset] --> B
F[App startup] --> G[Remove legacy preference]
Technical reviewBest possible solution: Keep setup input transient, remove its legacy preference at startup, and preserve existing connection and reset owners as this patch does. Do we have a high-confidence way to reproduce the issue? The current-main TextField writes directly through AppStorage, establishing persistence from source; the author also reports reproducing the stored value in a simulator plist. Is this the best way to solve the issue? This is the smallest complete fix: use the existing transient input owner, remove the legacy value, and preserve reset clearing without adding another storage or credential path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 44a2948a9eaf. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3. Total +3 across 4 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 HistoryReviewed November 11, 2026, 1:49 AM ET / 06:49 UTC (Revision 3). |
|
Upgrade proof: latest stable
I compared the plist by key name, type and a hash of each value, never the values themselves. The test Gateway returns the same model-config error to chat on both builds, so it has nothing to do with this change. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Addressed the review item in |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
* fix(ios): stop persisting pasted setup codes * fix(ios): clear a pasted setup code when onboarding resets
Keep credential-bearing pasted codes in view memory and delete legacy preferences at startup. Clear mounted Settings on onboarding reset. Release adaptation: add two guards in the existing native source suite. Native Swift checks remain unrun on this Linux host; qualification required. Independent review omitted per release owner, not passed. Companion #197172 retires a different deep-link key; not a dependency. (cherry picked from commit 66e7e2d) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Adapt to the 2026.11.4 release owners and fixtures; preserve current safety and timeout contracts. Source inspected by release owner. Independent local review explicitly waived by Dallin; CI qualification remains pending. (cherry picked from commit 66e7e2d) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
The setup code field in Settings → Gateway was backed by
@AppStorage("gateway.setupCode"), so every pasted or typed character was saved to the app's preferences plist. A setup code carries Gateway credentials: a bootstrap token, token or password. When setup failed or was abandoned, the code stayed in plain text in the app container and in device backups. Onboarding already keeps the same input in memory (@State).Change
setupCodein@State, matching onboarding.OpenClawApp.initremoves the oldgateway.setupCodekey at launch, next to the existingshare.defaultInstructioncleanup, so existing installs don't keep an earlier code.Evidence
iPhone 17 simulator (iOS 27), reading
gateway.setupCodefrom the app's preferences plist. I pasted a fake code and terminated the app without connecting.gateway.setupCodemainSwiftFormat and SwiftLint strict are clean.
Found by an audit of the iOS app.