Repository navigation
fix(dashpay): sign in to an app from the Home Scan shortcut - #1237
llbartekll wants to merge 2 commits into
Conversation
The Scan shortcut's scanner only understood payment codes, so a dash-key: / dash-st: QR was rejected as "Not a Dash QR code". The scan model now hands a DashConnect URI to a delegate that implements the new optional qrScanModel:didScanDashConnectURI:, before the payment parse. Only Home implements it, and routes the code to the Connections screen the same way a tapped DashConnect link does. The Send and lock-screen scanners are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o go next A code from the Home scanner reached the Connections screen through the deep-link path, so App Connect treated it as an on-device link and opened the app's callback in the browser after approval. The hosting controller now remembers that the code was scanned and hands it to onQRScanned; a tapped link still goes through onURIReceived. An approval that finishes the sign-in (the one-QR login or App Connect v2) of a scanned request now ends with "Connected to <app>. Go back to your browser to continue." A link returns through its callback instead, and the two-QR login still waits for the app's key-registration code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Final review complete — no blockers (commit 916956c) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Static verification of c0b97f9..916956c confirms the Home scanner handoff, scan-versus-link provenance, callback suppression, and two-QR exclusion; no blocking defect was identified. The two reviewers' overlapping test-coverage suggestions are combined into one non-blocking finding. Current CI shows the simulator tests pending and accessibility and test-target membership checks passing; the supplied clean-merge evidence and inspected base changes show no superseding implementation.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The change spans scanner delegation, navigation, scan-versus-link routing, and approval feedback, but does not alter cryptography, key handling, or funds movement. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `DashWallet/Sources/UI/DashConnect/ConnectionsViewModel.swift`:
- [SUGGESTION] DashWallet/Sources/UI/DashConnect/ConnectionsViewModel.swift:242-249: Cover the scan-only success message with approval regression tests
The new success message depends on both the approved login kind and whether the request arrived by scan or link, but no test asserts this behavior. The callback tests only inspect opened URLs, and testOnlyTheOneQrLoginSignsInAtApproval covers oneQR, twoQR, and unresolved while omitting appConnect and refused. Extend the existing LoginApprovalSpy-based tests to verify that successful scanned oneQR and appConnect approvals publish a success message containing the app label, linked and twoQR approvals do not publish that message, and failed approvals do not report success. Complete the classification assertions for appConnect and refused as well. This protects the PR's new user-visible behavior without introducing new test infrastructure.
| if consent.login.signsInAtApproval, !pendingRequestArrivedByLink { | ||
| message = ConnectionsScreenMessage( | ||
| kind: .success, | ||
| text: String( | ||
| format: NSLocalizedString( | ||
| "Connected to %@. Go back to your browser to continue.", | ||
| comment: "DashConnect: a sign-in finished at approval; the placeholder is the app's name"), | ||
| consent.appLabel) |
There was a problem hiding this comment.
🟡 Suggestion: Cover the scan-only success message with approval regression tests
The new success message depends on both the approved login kind and whether the request arrived by scan or link, but no test asserts this behavior. The callback tests only inspect opened URLs, and testOnlyTheOneQrLoginSignsInAtApproval covers oneQR, twoQR, and unresolved while omitting appConnect and refused. Extend the existing LoginApprovalSpy-based tests to verify that successful scanned oneQR and appConnect approvals publish a success message containing the app label, linked and twoQR approvals do not publish that message, and failed approvals do not report success. Complete the classification assertions for appConnect and refused as well. This protects the PR's new user-visible behavior without introducing new test infrastructure.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general)
Summary
Scanning a Yappr login QR with the Home Scan QR shortcut failed with "Not a Dash QR code". Users had to know to open More → Connections and scan from there. Two commits fix this, on top of the commit TestFlight 9.1.4 (12) was built from:
dash-key:/dash-st:code before the payment parse and hands it to Home, which opens the Connections screen with it.Changes
DWQRScanModel: the new optional delegate methodqrScanModel:didScanDashConnectURI:receives a DashConnect URI before the payment parse. Delegates that don't implement it keep the old behavior, so the lock screen and the Send / Enter Address scanners still say "Not a Dash QR code".DashConnectDeepLink.uriFromString:: the deep link and the scanner share one scheme check.HomeViewController→MainTabbarController.openDashConnect(_:scanned: true)→DashConnectHostingControllerremembers that the code was scanned and callsConnectionsViewModel.onQRScanned. Links still callonURIReceived, so a link still returns through its callback.AppConnect.Login.signsInAtApproval: true foroneQRandappConnect, false fortwoQR,unresolvedandrefused. The two-QR login still waits for the app's key-registration code, so it gets no "Connected" message.ConnectionsViewModel.approvePendingRequest: shows the "Connected to %@" success alert only when the login signs in at approval and the request did not arrive by link.Localizable.stringscatalogs, in English, after"Connected since %@".Testing
c0b97f9ac+ these two commits, platformb8b5627910):DashConnectUriTests(scanned string accepts both schemes and rejects payment codes) andtestOnlyTheOneQrLoginSignsInAtApproval.DashConnectUriTestspassed locally on a develop-based build.b8b5627910here, so this is left to CI.c0b97f9ac(the TestFlight 9.1.4 (12) commit). A trial merge into the currentqa/yappr-login(653a47d23) is clean.Related: #1236 has commit 1 against
feat/app-connect-request-v2(#1204).🤖 Generated with Claude Code