Repository navigation
fix(dashpay): open DashConnect codes from the Home scanner - #1236
llbartekll wants to merge 1 commit 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>
|
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 — 1 blocking finding(s) (commit e57bf17) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The Home-only routing is correctly scoped and preserves existing payment handling for other scanner delegates. However, the advertised App Connect v2 outcome is not implemented at this exact head: the production Connections entry point still sends dash-key requests to the v1-only parser. Current CI checks, including simulator unit tests, pass; this verification was static, with no local builds or tests run.
🔴 1 blocking
Review provenance
Source: reviewer 1: glm-5.3-flash (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:
lowbygpt-6.1-sol(effort low) — The diff adds a small, contained scanner-routing path using existing URI recognition and connection handling, without changing payment execution, key handling, or protocol parsing. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 94% left; passed overgemini-3.8-flash-high(lane failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); 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/Home/HomeViewController.swift`:
- [BLOCKING] DashWallet/Sources/UI/Home/HomeViewController.swift:757-760: The new scanner route does not reach an App Connect v2 flow
This handoff reaches openDashConnect → DashConnectHostingController → ConnectionsViewModel.onURIReceived → PlatformDashConnectDataSource.parseQR. At lines 539–542, parseQR unconditionally sends dash-key requests to parseKeyRequest, whose envelope parser requires v=1. parseAppConnectRequest has no production caller. Consequently, scanning a v2 login request opens Connections but rejects the request instead of presenting the advertised v2 approval flow. Exercising the v2 parser separately, or observing approval on a different develop-based build, does not validate this production route at the reviewed head.
The missing integration is inherited from the base, and the scanner plumbing itself is correct, but this PR explicitly promises that scanned App Connect v2 requests enter the v2 flow. Complete that integration in the owning DashConnect data-source/ViewModel flow and add regression coverage through the production request entry point. If this PR is intentionally scanner-routing-only, correct the description and testing claims and link a follow-up tracking the deferred v2 integration; no such tracking is supplied.
| func qrScanModel(_ viewModel: DWQRScanModel, didScanDashConnectURI uri: String) { | ||
| dismiss(animated: true) { [weak self] in | ||
| (self?.tabBarController as? MainTabbarController)?.openDashConnect(uri) | ||
| } |
There was a problem hiding this comment.
🔴 Blocking: The new scanner route does not reach an App Connect v2 flow
This handoff reaches openDashConnect → DashConnectHostingController → ConnectionsViewModel.onURIReceived → PlatformDashConnectDataSource.parseQR. At lines 539–542, parseQR unconditionally sends dash-key requests to parseKeyRequest, whose envelope parser requires v=1. parseAppConnectRequest has no production caller. Consequently, scanning a v2 login request opens Connections but rejects the request instead of presenting the advertised v2 approval flow. Exercising the v2 parser separately, or observing approval on a different develop-based build, does not validate this production route at the reviewed head.
The missing integration is inherited from the base, and the scanner plumbing itself is correct, but this PR explicitly promises that scanned App Connect v2 requests enter the v2 flow. Complete that integration in the owning DashConnect data-source/ViewModel flow and add regression coverage through the production request entry point. If this PR is intentionally scanner-routing-only, correct the description and testing claims and link a follow-up tracking the deferred v2 integration; no such tracking is supplied.
source: glm-5.3-flash (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general)
|
Superseded by #1237, which carries this commit plus the follow-up (a Home-scanned code goes in as a scan, so App Connect doesn't open the browser callback, and a "Connected — go back to your browser" alert after the sign-in), based on the qa/yappr-login commit TestFlight 9.1.4 (12) was built from and verified on device. |
Summary
The Home Scan QR shortcut only understood payment codes, so scanning a DashConnect login QR (
dash-key:/dash-st:) failed with "Not a Dash QR code". Users had to know to open More → Connections and scan from there.Now the Home scanner recognizes a DashConnect URI and opens the Connections screen with it, the same route a tapped
dash-key:/dash-st:link already takes (MainTabbarController.openDashConnect).Stacked on #1204 (
feat/app-connect-request-v2), so a scanned App Connect v2 request goes into the v2 flow.Changes
DWQRScanModel: before the payment parse, a scanned DashConnect URI is handed to the new optional delegate methodqrScanModel:didScanDashConnectURI:. A delegate that doesn't implement it gets the old behavior.HomeViewController: the only implementer. It dismisses the scanner and callsopenDashConnect. The lock screen and the Send / Enter Address scanners still treat these codes as not-a-payment.DashConnectDeepLink: addsuriFromString:, so the deep link and the scanner share one scheme check (DashConnectUri.isKeyUri/isStUri).Testing
DashConnectUriTests: 25/25 pass on the develop-based build, including 2 new tests. They check that the scanned-string check acceptsdash-key:/dash-st:(with surrounding whitespace) and rejects an address,dash:,pay:,https:and an empty string.DashConnectUri/AppConnectRequesttogether withDashConnectDeepLinkand ran them on the real Yappr staging v2 QR (dash-key:…?n=t&v=2&cb=https://yap.pr/staging/connect/…). The Home scanner routes it, andparseAppConnectRequestdecodes it.a9336f9486platform pin, so that is left to CI.🤖 Generated with Claude Code