Skip to content

Integrate indexed event idempotency into poller dispatch #54

Description

@pragmaticAweds

Context

EventRepository can record deterministic event identity, and the guidelines require idempotent processing. The current poller and handler registry process events but do not yet skip already-recorded events or record successful processing as part of dispatch.

Scope

  • Define how SorobanEventInput maps to indexed event identity fields
  • Add a poller or dispatcher integration point for EventRepository
  • Skip events that are already recorded as processed
  • Record event identity only after all matching handlers succeed
  • Ensure failed or retriable handler results do not advance idempotency state
  • Add tests for duplicate events, successful processing, handler failure, and no-handler events

Out of Scope

  • Creating the indexed events table
  • Building domain-specific repositories
  • Changing Soroban contract event formats

Acceptance Criteria

  • Reprocessing the same event does not call domain handlers twice
  • Failed handler dispatch leaves the event unrecorded for retry
  • Event identity includes contract ID, ledger number, transaction hash or paging token, and deterministic event index when available
  • Behavior is covered by unit tests with mocked repositories and handlers
  • bun run indexer:type-check passes
  • bun run indexer:test passes
  • bun run indexer:lint passes

Dependencies

Suggested Files or Packages

  • indexer/common/src/poller/
  • indexer/common/src/handlers/
  • indexer/common/src/db/repository.ts

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

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