Skip to content

[Testing] Indexer per-event failure path (batch continues, cursor advances past failed event) has no test #846

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

tests/soroban-event-worker.test.ts covers idempotency/dedup and happy-path replays only. The failure branch in fetchAndProcessEvents - where one event throws but the batch continues and persists a later cursor - is the exact path behind the data-loss bug and is completely uncovered.

Acceptance criteria

  • Add a test with a mocked getEvents batch where the first event's handler rejects and a later one resolves
  • Assert the persisted IndexerState.lastCursor is NOT advanced beyond the failed event
  • Assert the successful events are still written exactly once

Files to touch

  • backend/tests/soroban-event-worker.test.ts
  • backend/src/workers/soroban-event-worker.ts

Out of scope

  • Real Soroban RPC integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend related taskstestingTesting related tasks

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions