Open
Conversation
tonyxiao
requested changes
Apr 24, 2026
|
|
||
| /** Exclude streams that already reached a terminal state in prior run progress. */ | ||
| /** | ||
| * Exclude streams that already reached a terminal state in prior run progress. |
Collaborator
There was a problem hiding this comment.
I don't think this should happen because webhook will not have the same ID as backfill
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.
Summary
Fix a silent live-event regression on same-run continuation. Completed streams were being pruned from the catalog, which caused Stripe webhook / WebSocket / events-API messages for those streams to be dropped at both the source and destination filters.
excludeTerminalStreamsnow takes akeepCompletedoption, andpipeline_syncopts in.Problem
When a pipeline resumes under the same
run_id, the engine trims "already done" streams out of the catalog viaexcludeTerminalStreams. Until now that bucket includedcompletedalongsideskippedanderrored.The problem: once a stream's backfill finished, it vanished from the catalog on every subsequent continuation — and two downstream filters quietly threw away every live event for it:
streamNamesfrom the catalog and filters every live event (webhook / WebSocket / events-API) through it, so events for completed streams never yielded a record.enforceCatalogdrops any record whose stream isn't in the catalog, so anything that escaped the source filter was swallowed here.The pipeline looked healthy (no errors,
status: completed), but real-time data stopped flowing after the first continuation.Fix
Treat
completedas "backfill done"excludeTerminalStreamstakes a newopts.keepCompleted(defaultfalse, backward compact)Both continuation sites in
pipeline_sync(activeFilteredCatalogandactiveCatalog) pass{ keepCompleted: true }.New unit test in
apps/engine/src/lib/destination-filter.test.ts: completed streams are kept whenkeepCompleted: true, skipped/errored are still excluded.Updated engine test
skips skipped/errored streams but keeps completed streams on same-run continuation— asserts the source now receives completed streams and their status is re-emitted.