Repository navigation
fix: confirm spark payouts when electrum fails - #1304
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bfe85fb3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Triage: milestone 3.2.0. This PR fixes contact payouts from Spark, which is 3.2.0 work, and closes no issue, so it carries the milestone itself. |
[Medium impact] This PR appears safe to merge. SummaryFailed Electrum address reads now fall back to the payout transaction’s status on Esplora, just like missing outputs already do.
Reviews (1) · Last reviewed commit: "fix: confirm a spark payout from its tra..." · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. A failed Electrum read of a contact payout's address now falls through to the payout transaction's Esplora status, as a missing output already did, so the activity can leave Confirming. Reviewed 9bfe85f, full tier, static: no build, because iOS does not build on this reviewer's Linux host.
What I checked, and 3 candidates I ruled out
Read in full: confirmMinedPayouts and its one caller confirmMinedContactPayouts in SparkManager.swift; the new test and its neighbours in SparkWithdrawalTests.swift
CI: SwiftFormat and Greptile green; Run Tests still running at review time
Ruled out
- An unmined payout confirmed by the fallback:
isMinedreadstxStatus(...).confirmedand maps a 404 to false, so an emptyoutputsonly confirms what Esplora says is in a block. - An Esplora error now swallowed: a throwing
isMinedstill reaches the outercatch, which logs and leaves the activity unconfirmed, the same as before for a missing output. - Changelog fragment: the base is
feat/breez-spark-lightning, the unreleased Spark feature, so this fixes behaviour no release shipped.
Merge confidence: 4/5, no findings, but the unit-test job had not finished when I reviewed; testAPayoutIsConfirmedFromItsTransactionWhenElectrumFails covers the change.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the runtime does not report it)
coreyphillips
left a comment
There was a problem hiding this comment.
Two independent reviews, nothing blocking a merge.
jvsena42
left a comment
There was a problem hiding this comment.
No findings. A thrown Electrum read now becomes outputs = [] and falls through to Esplora isMined (SparkManager.swift:1639-1646). An unmined payout stays unconfirmed (404 → false), and an Esplora error still leaves the activity alone. Android's second fix isn't needed here: markOnchainActivityAsConfirmed (CoreService.swift:1528) re-reads the activity on the core queue and returns if it's missing or already confirmed. testAPayoutIsConfirmedFromItsTransactionWhenElectrumFails fails on the base.
Device gate: no device check needed: no UI change beyond the activity leaving Confirming; the unit test covers it. perf: one Esplora read per unconfirmed contact payout per refresh while Electrum fails, off the refresh path. CI: Run Tests still pending at 9bfe85fb3.
Reviewer model: Claude Fable 5.2 (claude-fable-5-2), Claude Opus 5.5 (claude-opus-5-5)
Reasoning effort: not exposed
|
Merging into |
Twin: synonymdev/bitkit-android#1754
Description
markOnchainActivityAsConfirmedalready reads the activity again when it writes.Design
N/A — no UI changes.
Preview
N/A — no visible change other than the activity leaving Confirming.
QA Notes
Automated Checks
SparkWithdrawalTests.testAPayoutIsConfirmedFromItsTransactionWhenElectrumFails: a payout whose address read fails is confirmed from its transaction's status.BitkitTestssuite passes on CI on this branch. SwiftFormat 0.64.6 lint is clean.Not tested