Skip to content

[Backend] Pause/resume controllers persist placeholder-txHash PAUSED/RESUMED events that the indexer re-writes - duplicate history rows #804

Description

@grantfox-oss

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

Why this matters

stream.controller.ts:641-650 (pause) and :740-752 (resume) write a StreamEvent with transactionHash = result.txHash, which sorobanService returns as the fabricated simulated-pause- / simulated-resume- and ledgerSequence:0. When the genuine on-chain event is later indexed, the worker inserts a SECOND StreamEvent keyed on the real txHash. Because @@unique is (transactionHash, eventType) and the two txHashes differ, both rows survive -> duplicate PAUSED/RESUMED entries with a bogus ledgerSequence 0.

Acceptance criteria

  • Stop writing a synthetic-txHash StreamEvent in the pause/resume controllers, or reconcile/replace it when the real indexed event arrives
  • Ensure pause/resume state is written by exactly one source
  • Add a test that pauses then indexes the real stream_paused event and asserts a single PAUSED row

Files to touch

  • backend/src/controllers/stream.controller.ts
  • backend/src/services/sorobanService.ts
  • backend/src/workers/soroban-event-worker.ts

Out of scope

  • Real frontend-signed transaction submission flow

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksbugSomething isn't workingdatabasePostgreSQL / Prisma

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