Fix #804: Stop pause/resume controllers from duplicating PAUSED/RESUMED events#981
Open
Banx17 wants to merge 1 commit into
Open
Fix #804: Stop pause/resume controllers from duplicating PAUSED/RESUMED events#981Banx17 wants to merge 1 commit into
Banx17 wants to merge 1 commit into
Conversation
…SED/RESUMED events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes issue #804 by stopping the
stream.controller.tsfrom creating syntheticPAUSEDandRESUMEDevents 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 bySorobanEventWorker. Now, the state updates are fully delegated to the indexer, ensuring exactly one source of truth.Related Issue
Closes #804
Changes
prisma.stream.updateandprisma.streamEvent.createinpauseStreamandresumeStreamhandlers.pause-resume.regression.test.tsto assert thatpauseStreamcontroller no longer modifies the DB, and exactly onePAUSEDrow is created by the indexer.stream-actions.test.tsto 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