feat: thread sourceId through PulseEmitter#70
Merged
Conversation
The data-pathways control-plane uses (pathway_id, source_id) as the unique key for pump_pulses rows. Without sourceId in the pulse payload, every pulse lands on a NULL-sourceId row per flowType — shadowing any correctly keyed siblings and making multi-source identity impossible. Changes: - Add optional sourceId to the `pulse` option on FlowcoreDataPumpOptions - Capture sourceId in the PulseEmitter snapshot closure - Forward it to SendPumpPulseCommand input The upstream @flowcore/sdk is pinned at ^1.78.0 in this repo but SendPumpPulseInput gained sourceId only on the 3.x train (see flowcore-sdk#219). Until data-pump migrates to sdk 3.x we cast the command input through its constructor-parameter type, which lets the field pass through getBody() → POST body unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4fde358 to
208f42e
Compare
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
sourceId?: stringto thepulseoption onFlowcoreDataPumpOptionsPulseEmittersnapshot closureSendPumpPulseCommandinputWhy
The data-pathways control-plane uses
(pathway_id, source_id)as the unique key forpump_pulsesrows. WithoutsourceIdin the pulse payload, every pulse lands on a NULL-sourceId row per flowType — shadowing any correctly keyed siblings and making multi-source identity impossible. Result in prod today: dashboards show two rows per flow type (one frozen, one NULL-sourced).Note on the sdk cast
Upstream
@flowcore/sdkis pinned at^1.78.0here butSendPumpPulseInputgainedsourceIdonly on the 3.x train (see flowcore-sdk#219). Until data-pump migrates to sdk 3.x I cast the command input through its constructor-parameter type. That lets the field pass throughCommand.getBody()→ POST body unchanged. When the sdk migration lands, the cast can be removed.Test plan
deno check src/mod.tscleandeno test test/tests/pulse.test.ts— 3 new tests coveringPulseSnapshot.sourceIdshape + back-compat0.19.1→0.20.0) — additive API surface change🤖 Generated with Claude Code