Skip to content

feat: add safe retry policy for transaction submissions#200

Merged
El-swaggerito merged 1 commit into
Axionvera:mainfrom
vic2430:feat/safe-retry-policy
Jul 22, 2026
Merged

feat: add safe retry policy for transaction submissions#200
El-swaggerito merged 1 commit into
Axionvera:mainfrom
vic2430:feat/safe-retry-policy

Conversation

@vic2430

@vic2430 vic2430 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
  • 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

closes #172

- 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
@El-swaggerito
El-swaggerito merged commit 3ca747d into Axionvera:main Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add SDK transaction retry safety policy

2 participants