feat: add safe retry policy for transaction submissions#200
Merged
Conversation
- Add SubmissionOutcome discriminated union (success, retryable_failure, non_retryable_failure, unknown_status) to src/types/index.ts - Add RetryPolicy and RetryPolicyExhaustedResult interfaces - Add classifySubmissionOutcome(), isSafeToRetry(), requiresStatusCheck() to src/errors/index.ts - Add withRetryPolicy() in src/network/retry-policy.ts — applies exponential backoff only to retryable outcomes; delegates unknown_status to submitTransactionIdempotently (status polling) instead of blind resubmission, preventing duplicate payments - Export all new symbols from src/index.ts - Add 34 unit tests covering all outcome variants, duplicate-risk guard, exhaustion handling, and onAttempt callback - Add docs/retry-policy.md with outcome table, decision tree, API reference, and no-blind-resubmission guarantee - Update README.md with link to retry-policy doc
5 tasks
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.
closes #172