Skip to content

Classify and retry transient per-invoice failures in the batch escrow reader #435

Description

@mikewheeleer

Classify and retry transient per-invoice failures in the batch escrow reader

Description

src/services/escrowBatchRead.js isolates per-invoice errors so one failure does not sink the whole batch — good — but it never retries any of them, even clearly transient ones (timeouts, 5xx). For a marketplace listing this means a momentary RPC blip silently drops invoices from the page. Transient per-invoice errors should be retried (using the unified Soroban classifier) before being isolated as failed.

Requirements and context

  • Repository scope: Liquifact/Liquifact-backend only.
  • For each per-invoice read, retry transient failures with bounded backoff before recording the invoice as errored.
  • Reuse the Soroban error classifier and retry primitives from src/services/soroban.js rather than re-implementing.
  • Keep the overall batch timeout and concurrency bounds intact; never let retries blow the batch budget.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b enhancement/escrow-batch-read-transient-retry
  • Implement changes
    • Write code in: src/services/escrowBatchRead.js.
    • Write comprehensive tests in: tests/escrow.batch.test.js — assert transient errors retry and recover, permanent ones isolate.
    • Add documentation: note the retry behavior in the escrow integration overview.
    • JSDoc the per-invoice retry path.
    • Validate security: ensure retries cannot amplify load into a self-DoS under sustained failure.
  • Test and commit

Test and commit

  • Run npm test and npm run lint.
  • Cover edge cases: transient-then-success, persistent transient, and permanent error.

Example commit message

feat: retry transient per-invoice failures in batch escrow reader

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the Liquifact community on Discord for questions, reviews, and faster merges: https://discord.gg/JrGPH4V3
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions