Fix mint-to-mint transfer reliability#71
Open
zeugmaster wants to merge 6 commits into
Open
Conversation
…transfer event helpers - pollAndIssue: polls the destination mint quote until paid, then issues ecash with retry and exponential backoff on transient errors (~30s budget) - pure resumeAction decision function (destination-first state machine) - classifyMeltFailure: distinguish definitive-unpaid from unknown outcome - Event.transferMints orients from/to via the proofs relationship because SwiftData does not preserve to-many relationship array order - persist mint quote expiry into pending transfer events (existing field) - fix latent index trap in EventList/EventSummary mint labels Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nagers - issue step now uses TransferFlow.pollAndIssue instead of a single-shot mint call; failures park the transfer as resumable pending state - melt failures only revert inputs to valid when the mint verifiably reports the quote unpaid; unknown outcomes (timeouts) keep proofs pending and preserve event data instead of wiping blankOutputs/proofs - melt errors trigger a one-shot meltState recheck: a payment that settled despite a thrown error now continues into issuance - resumeTransfer checks the destination mint quote first and no longer requires meltQuote/proofs/blankOutputs for the recovery path - new .pending state handled in SwapView, BalancerView, RedeemView - TransferView: live quote status rows and expiry instead of data- presence checkmarks, alert view was never attached (errors were silently swallowed), removal now verifies unpaid state and per-proof NUT-07 state with the mint before reverting Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SwiftData does not preserve to-many relationship array order (proven by test: [A, B] came back [B, A] after a single save), so the positional from/to convention on Event.mints is unreliable. New transfer events now carry unidirectional optional fromMint/toMint relationships, set on creation and preferred by transferMints. Existing rows stay untouched and resolve via the proofs-orientation/positional fallback. Adding optional relationships is a lightweight migration; verified by an on-disk store test (pre-change schema -> current schema -> reopen) and the existing legacy-store migration tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CashuSwift: payment-methods branch -> up to next minor from 0.4.1 Bolt11: main branch -> up to next minor from 0.1.3 The branch pins forced a stale Bolt11 revision over cashu-swift's exact 0.1.3 requirement, breaking the build against Bech32Swift 1.0.1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add translations (ar, bn, de, es, fr, hi, ja, ko, pt-BR, ru, tr) for the new transfer-flow strings and for previously untranslated keys — 56 keys, 617 translations. Catalog is now fully translated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the reported fund-loss scenario where a transfer's lightning payment succeeded but the ecash issuance at the destination mint failed, leaving funds stranded as a paid-but-unissued mint quote that seed restore cannot recover.
Transfer flow
TransferFlowengine, used by both swap managers).Data model
Event.fromMint/toMintrelationships set on creation — SwiftData does not preserve to-many array order (proven by test), so positionalmints[0]/[1]was unreliable. Existing rows are untouched and resolve via a proofs-orientation fallback. Lightweight migration verified by an on-disk store test.UI
Dependencies
Localization
Test plan
TransferFlowTests): error classification, resume decision table, poll/retry backoff behavior, endpoint resolution, on-disk lightweight migration. All passing, plus existing legacy-store migration tests.🤖 Generated with Claude Code