Description
backend/src/stellar-service-integration/rate-limiter.ts's isRetryableError treats any error whose message contains both "not found" and "transaction" as retryable, which also matches a genuinely nonexistent or typo'd transaction hash — that lookup gets retried up to the configured max attempts and backoff for no reason.
Requirements and Context
- Narrow the predicate to only match the specific transient not-found condition it's meant for
- Do not regress the genuinely transient case (a real transaction not yet indexed)
Suggested Execution
Branch: fix/integration-retryable-error-predicate
Implement Changes
- Narrow the predicate to only match the specific transient not-found condition it's meant for (e.g. by error code/type rather than a substring match on the message)
- Add a test asserting a permanently-invalid transaction hash lookup does not get retried the full attempt budget
- Add a test asserting the genuinely transient case (not yet indexed) still retries as before
Test and Commit
Run npx vitest run src/stellar-service-integration/__tests__ — a permanently-invalid transaction hash fails fast while a genuinely transient not-found still retries.
Example Commit Message
fix(backend): narrow the retryable-error predicate for transaction lookups
Closes #<issue>
Guidelines
- Branch from
main, open a PR back to main
- All new code must have corresponding tests
- Run
npm run lint and npm run test before pushing
- Follow existing naming conventions and file structure
- PR description must reference this issue number (e.g.,
Closes #<issue>)
- Keep commits atomic and use conventional commit format
Description
backend/src/stellar-service-integration/rate-limiter.ts'sisRetryableErrortreats any error whose message contains both "not found" and "transaction" as retryable, which also matches a genuinely nonexistent or typo'd transaction hash — that lookup gets retried up to the configured max attempts and backoff for no reason.Requirements and Context
Suggested Execution
Branch:
fix/integration-retryable-error-predicateImplement Changes
Test and Commit
Run
npx vitest run src/stellar-service-integration/__tests__— a permanently-invalid transaction hash fails fast while a genuinely transient not-found still retries.Example Commit Message
Guidelines
main, open a PR back tomainnpm run lintandnpm run testbefore pushingCloses #<issue>)