fix(ios): defer QR pairing after scanner dismissal#99572
Conversation
827934a to
d7700b8
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 3:28 PM ET / 19:28 UTC. Summary PR surface: Source +36, Tests +28, Docs +1, Other +7547. Total +7612 across 65 files. Reproducibility: yes. The linked issue has physical iPhone current-main crash evidence, and current-main source still sends scanner results directly from the VisionKit callback into pairing work; I did not rerun the crash on a device. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the scanner-dismissal and gateway-ownership fix after a fresh physical iPhone QR pairing proof on the exact current head and after removing the release-owned changelog edit. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue has physical iPhone current-main crash evidence, and current-main source still sends scanner results directly from the VisionKit callback into pairing work; I did not rerun the crash on a device. Is this the best way to solve the issue? Yes, the scanner-dismissal owner path is the best fix shape for this UIKit/VisionKit race. The remaining gaps are exact-head physical proof and removal of the release-owned changelog edit, not a different runtime layer. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f141408e7749. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +36, Tests +28, Docs +1, Other +7547. Total +7612 across 65 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (16 earlier review cycles; latest 8 shown)
|
|
Follow-up pushed at What changed:
Verification:
No fresh physical-device proof in this update; this directly targets the presentation timing race Wouter saw after the crash fix. |
8ee81ce to
93afb17
Compare
|
Maintainer repair is pushed on exact head The final branch now stops VisionKit scanning before requesting sheet dismissal, carries one typed pending result, and delivers pairing only from the sheet The remaining merge gate is physical-iPhone camera proof on this exact head. Please run a fresh QR through both:
For each, confirm the scanner closes, pairing/trust UI proceeds, the gateway connects, and there is no crash or first-scan prompt flash. A redacted screen recording or screenshots plus device/iOS version are sufficient. |
|
Physical-device follow-up on Polly's iPhone, exact PR head Onboarding QR still shows the same first-scan behavior: the trust prompt appears briefly and then disappears before the user can act. The imported phone video from the previous build showed this is not just scanner-dismissal timing: the prompt appears after the scanner is gone, then the app transitions out of onboarding/main presentation and the prompt is lost. I tried keeping onboarding open for Current contributor status: crash fix still looks separate, but the remaining onboarding trust-prompt flash is not solved by the dismissal delay or the first RootTabs onboarding guard. We'll continue diagnosis from the view/presentation lifecycle tomorrow before adding proof. |
|
Merged via squash.
|
What Problem This Solves
Fixes #99571.
Fixes an issue where iOS users scanning a gateway pairing QR could have the scanner dismiss at the wrong time, lose the trust/approval handoff, or crash while VisionKit was still stopping camera capture.
The affected surfaces are the iOS onboarding scanner, Gateway Settings scanner, app/open-url setup-link handling, and post-scan gateway approval handoff.
Why This Change Was Made
The scanner now stops VisionKit scanning, queues one typed QR/setup result, dismisses the scanner sheet, and processes pairing only from the sheet dismissal path after a short main-actor settling delay. The final branch also handles setup links delivered during app/onboarding launch by staging UIKit app-delegate URLs through the same gateway setup-link path used by SwiftUI
.onOpenURL.This keeps the scanner lifecycle separate from gateway trust UI and avoids re-entering the onboarding/settings presentation stack while VisionKit is still dismissing.
User Impact
iOS users can pair a gateway by scanning a QR code from onboarding or from Settings without losing the approval flow. After approval, the app reaches Chat and can send/receive messages immediately.
Evidence
2026.6.11 / 488.OpenClaw-2026-07-03-160229.ips, app bundleai.openclawfoundation.app.test.pollybot-5y97h9j837.EXC_CRASH/SIGABRT,+[UIAlertController _alertControllerContainedInViewController:], with VisionKit stoppingAVCaptureSessiononcom.apple.visionkit.avcapturequeue.11583731daa4a73d52b8a473f0f75b6636f749e4, app build2026.6.11 / 63927, gateway/CLI2026.6.11.openclaw devices listafter proof showed the iPhone paired with both node and operator scopes and no pending approval request.11583731daa4a73d52b8a473f0f75b6636f749e4is green;mergeStateStatusisCLEAN.Local validation:
git diff --checkpnpm native:i18n:checkRootTabsSourceGuardTestspassed on iPhone 17 / iOS 26.5, including callback-order guards for both scanner owners and stop-before-delivery.AI-assisted: yes.