Repository navigation
fix(explore-dash): report a DashSpend payment the merchant acknowledged before it failed as in progress - #1408
romchornyi wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 50 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The implementation correctly maps BIP70 failures after merchant acknowledgement into the existing in-progress DashSpend state and preserves the wire-order transaction ID. Two non-blocking issues remain: the PR title fails the repository's allowed-scope check, and comments now overstate that every payment-status-unknown case was broadcast. The legacy interactive BIP70 path has a related pre-existing gap, but it is outside this DashSpend-focused diff and should be handled separately.
🟡 1 suggestion(s) | 💬 1 nitpick(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
2 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: PR title uses a scope rejected by the semantic-title workflow
.github/workflows/semantic-pull-request.yml:41-54
The exact head fails both Validate PR title checks because the PR title uses fix(dashspend):, while the workflow allows explore-dash but not dashspend. Retitle the PR using an existing allowed scope, such as fix(explore-dash):, so the required title check can pass. This is a PR metadata issue rather than a code defect.
source: glm-5.3-flash (phase1-reviewer: general)
💬 Nitpick: paymentStatusUnknown documentation excludes the new acknowledged-but-unbroadcast case
DashWallet/Sources/Models/Explore Dash/Services/DashSpend/DashSpendError.swift:38-41
The new SendCoinsService catch arm maps failedAfterAcknowledgement to paymentStatusUnknown, but that error can be raised when the request expires after acknowledgement and before the wallet broadcasts, particularly because the DashSpend flow calls payWithDashUrl(..., awaitAcceptance: false). The case comment therefore incorrectly says the payment was broadcast. The corresponding DashSpendPayViewModel comment at lines 356–358 also says the payment left the device, which is not true for the expiry-after-acknowledgement path. Update both comments to describe the shared invariant: the merchant holds the signed transaction, while the wallet's broadcast/acceptance outcome is unknown.
source: glm-5.3-flash (phase1-reviewer: general)
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) — This is a small, well-contained mapping change in SendCoinsService with focused unit-test coverage and no changes to payment execution, funds movement, cryptography, or storage. - 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 57% left; passed overgemini-3.8-flash-high(antigravity quota lookup 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 (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `.github/workflows/semantic-pull-request.yml`:
- [SUGGESTION] .github/workflows/semantic-pull-request.yml:41-54: PR title uses a scope rejected by the semantic-title workflow
The exact head fails both `Validate PR title` checks because the PR title uses `fix(dashspend):`, while the workflow allows `explore-dash` but not `dashspend`. Retitle the PR using an existing allowed scope, such as `fix(explore-dash):`, so the required title check can pass. This is a PR metadata issue rather than a code defect.
In `DashWallet/Sources/Models/Explore Dash/Services/DashSpend/DashSpendError.swift`:
- [NITPICK] DashWallet/Sources/Models/Explore Dash/Services/DashSpend/DashSpendError.swift:38-41: paymentStatusUnknown documentation excludes the new acknowledged-but-unbroadcast case
The new `SendCoinsService` catch arm maps `failedAfterAcknowledgement` to `paymentStatusUnknown`, but that error can be raised when the request expires after acknowledgement and before the wallet broadcasts, particularly because the DashSpend flow calls `payWithDashUrl(..., awaitAcceptance: false)`. The case comment therefore incorrectly says the payment was broadcast. The corresponding `DashSpendPayViewModel` comment at lines 356–358 also says the payment left the device, which is not true for the expiry-after-acknowledgement path. Update both comments to describe the shared invariant: the merchant holds the signed transaction, while the wallet's broadcast/acceptance outcome is unknown.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Legacy interactive BIP70 flow still flattens acknowledged failures —
BIP70InteractiveCoordinatorconvertsfailedAfterAcknowledgementinto a genericNSError, andDWPaymentProcessorpresents it as a plain payment error without recording or surfacing the transaction ID. This is a real adjacent payment-flow gap, but the coordinator and Objective-C interactive path are unchanged by this DashSpend-specific fix and the error-producing behavior comes from the stacked service change. It should not block this PR.- Follow-up: A follow-up PR should update the legacy interactive BIP70 coordinator and delegate flow to preserve the acknowledged transaction ID, record the pending payment, and present an in-progress result for
failedAfterAcknowledgement.
- Follow-up: A follow-up PR should update the legacy interactive BIP70 coordinator and delegate flow to preserve the acknowledged transaction ID, record the pending payment, and present an in-progress result for
ee6d07f to
db9f501
Compare
db9f501 to
d17c09b
Compare
d17c09b to
4df936f
Compare
e86a8bb to
403e169
Compare
e0ac376 to
a4ec0bf
Compare
a4ec0bf to
f7d4443
Compare
23cdb94 to
ea8976d
Compare
…failed as in progress A gift-card payment whose Payment the merchant acknowledged, and whose broadcast then failed or whose request then expired, reached DashSpend as a plain error without the txid, while the merchant holds the signed bytes and may fulfil the order. payWithDashUrl now maps it to the same in-progress error as an unknown broadcast outcome, carrying the txid, so the purchase is recorded and the card details screen opens. The BIP70 service it pays through can be injected, so the mapping is tested against a fake wallet and merchant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: 5d5b668099682851d541bb92b75d2c6c0a8d87ca
ea8976d to
1d37be1
Compare
Issue being fixed or feature implemented
After #1407, a BIP70 payment whose request expired, or whose broadcast failed, after the merchant had already acknowledged the Payment is reported as
BIP70Error.failedAfterAcknowledgement.SendCoinsService.payWithDashUrldid not map it, so DashSpend showed a plain error without the txid while the merchant may still fulfil the order.What was done?
failedAfterAcknowledgementmaps toDashSpendError.paymentStatusUnknownwith its txid — the same handlingbroadcastOutcomeUnknownalready gets: DashSpend records the purchase against the txid and shows it in progress.SendCoinsServicetakes itsBIP70PaymentServicethrough an injectable factory (default unchanged) so the mapping is tested.Stacked on #1407.
Stack
This replaces the single PR #1358 (+21k lines), split by layer so each part can be reviewed and merged on its own. Merge in order:
chore(l10n): drop unused keys and sort the catalogs as BartyCrouch writes them (keeps the diffs below clean)How Has This Been Tested?
PaymentProtocolTests.testPayWithDashUrlReportsAFailureAfterTheAcknowledgementAsInProgressWithTheTxid; full suite 2587 tests, 0 failures, 1 skippedBreaking Changes
None.
Checklist:
🤖 Generated with Claude Code
Summary by CodeRabbit