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

Labels: backend, testing, Stellar Wave

The exact code path behind the data-loss bug has no test.

tests/soroban-event-worker.test.ts covers idempotency/dedup and the happy-path replay, but not the failure branch in fetchAndProcessEvents where one event throws, the batch keeps going, and a later cursor still gets persisted. That's the path that drops events, and right now nothing exercises it.

What the fix has to hold to

  • the test drives a real mixed batch: one handler rejects, a later one resolves
  • it pins the behavior we actually want (cursor not advanced past the failure, good events written once)

Done when

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

Where to start
backend/tests/soroban-event-worker.test.ts, referencing backend/src/workers/soroban-event-worker.ts. Real Soroban RPC integration is out of scope, keep it mocked. Note this test will likely fail until the underlying cursor bug is fixed, which is fine and kind of the point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programbackendBackend related taskstestingTesting related tasks

    Type

    No type

    Fields

    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