Skip to content

Fix #804: Stop pause/resume controllers from duplicating PAUSED/RESUMED events#981

Open
Banx17 wants to merge 1 commit into
LabsCrypt:mainfrom
Banx17:fix/804-duplicate-pause-resume-events
Open

Fix #804: Stop pause/resume controllers from duplicating PAUSED/RESUMED events#981
Banx17 wants to merge 1 commit into
LabsCrypt:mainfrom
Banx17:fix/804-duplicate-pause-resume-events

Conversation

@Banx17

@Banx17 Banx17 commented Jul 1, 2026

Copy link
Copy Markdown

Overview

This PR fixes issue #804 by stopping the stream.controller.ts from creating synthetic PAUSED and RESUMED events in the database when a stream is paused or resumed. Previously, the controllers would persist these events with a placeholder transaction hash, which led to duplicate history rows when the real on-chain event was indexed by SorobanEventWorker. Now, the state updates are fully delegated to the indexer, ensuring exactly one source of truth.

Related Issue

Closes #804

Changes

  • stream.controller.ts: Removed prisma.stream.update and prisma.streamEvent.create in pauseStream and resumeStream handlers.
  • tests: Added pause-resume.regression.test.ts to assert that pauseStream controller no longer modifies the DB, and exactly one PAUSED row is created by the indexer.
  • tests: Updated integration tests in stream-actions.test.ts to reflect the removed database mutation expectations.

Verification

npm run lint ✅ completed (existing repo warnings only)
npm run typecheck ✅ passed
npm test -- tests/integration/pause-resume.regression.test.ts ✅ passed
npm run build ✅ passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant