Skip to content

feat: thread sourceId through PulseEmitter#70

Merged
jbiskur merged 1 commit intomainfrom
feat/pulse-source-id
Apr 24, 2026
Merged

feat: thread sourceId through PulseEmitter#70
jbiskur merged 1 commit intomainfrom
feat/pulse-source-id

Conversation

@jbiskur
Copy link
Copy Markdown
Contributor

@jbiskur jbiskur commented Apr 23, 2026

Summary

  • Add optional sourceId?: string to the pulse option on FlowcoreDataPumpOptions
  • Capture it in the PulseEmitter snapshot closure
  • Forward it to SendPumpPulseCommand input

Why

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. Result in prod today: dashboards show two rows per flow type (one frozen, one NULL-sourced).

Note on the sdk cast

Upstream @flowcore/sdk is pinned at ^1.78.0 here but SendPumpPulseInput gained sourceId only 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 through Command.getBody() → POST body unchanged. When the sdk migration lands, the cast can be removed.

Test plan

  • deno check src/mod.ts clean
  • deno test test/tests/pulse.test.ts — 3 new tests covering PulseSnapshot.sourceId shape + back-compat
  • release-please bumps as minor (0.19.10.20.0) — additive API surface change

🤖 Generated with Claude Code

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>
@jbiskur jbiskur force-pushed the feat/pulse-source-id branch from 4fde358 to 208f42e Compare April 23, 2026 21:10
@jbiskur jbiskur merged commit 119f364 into main Apr 24, 2026
2 checks passed
@jbiskur jbiskur deleted the feat/pulse-source-id branch April 24, 2026 07:05
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.

1 participant