Repository navigation
Fix lost-response retries to reuse the identical payment - #6
Merged
Merged
Conversation
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.
A lost paid response previously restarted payment creation for the same quote. The helper now creates one transaction, saves its payment and request before sending, and re-signs the identical header or multipart body for up to three retries after 2, 5, and 10 seconds.
All sends, including manual recovery, are bounded by the quote's five-minute window, with a deadline check after signing. A verified already-claimed refusal stops retries and reports the txid. Exhaustion reports the txid, saved file, and executable
retry-paymentcommand. Recovery requires the original wallet identity. Signed success or an accepted refund removes the journal; unresolved payments retain it. Refunds are internalized once, and status-poll refunds still work.Includes the 1.1.3 version bump, changelog, README refund paragraph, and recovery instructions.
Validation:
python3 -m pytest -qpasses all 69 tests. Added mocked HTTP and wallet coverage for header and multipart reuse, BRC-104 verification, replay refusal, missing/unsigned responses, connection errors, timeouts, exhaustion and command replay, quote expiry and signing delay, pre-payment failures, identity binding, pending receipts, and refund handling.git diff --checkpasses. No live paid requests were made.