fix(ts-sdk): honor options.priority and options.scope in EventClient.bulkPush#3932
fix(ts-sdk): honor options.priority and options.scope in EventClient.bulkPush#3932sushaan-k wants to merge 1 commit into
Conversation
…bulkPush `EventClient.bulkPush(type, inputs, options)` silently dropped `options.priority` and `options.scope` because the per-event mapping only read those fields from each `EventWithMetadata` input and never fell back to the shared `options` argument. `additionalMetadata` already falls back to `options.additionalMetadata`, and `EventClient.push` honors all three fields from `options`, so the previous behaviour was inconsistent. Mirror the `additionalMetadata` fallback for `priority` and `scope` so the shared options argument applies to every event in the batch that does not set its own override. Closes hatchet-dev#3931
|
@sushaan-k is attempting to deploy a commit to the Hatchet Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency in the TypeScript SDK’s EventClient.bulkPush by ensuring options.priority and options.scope are applied as batch-wide defaults for events that don’t specify per-event overrides (matching push behavior and how additionalMetadata already works).
Changes:
- Apply
options.priority/options.scopeas fallbacks inbulkPush’s per-event request mapping (input.* ?? options.*). - Add a unit test validating both the shared-default behavior and per-event override precedence.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sdks/typescript/src/clients/event/event-client.ts |
Ensures bulk-pushed events inherit priority/scope from shared options when not set per event. |
sdks/typescript/src/clients/event/event-client.test.ts |
Adds coverage confirming defaults are applied and per-event values take precedence. |
|
This fix looks good! It makes |
|
@sushaan-k one release housekeeping request before merge: could you bump the TypeScript SDK package version in PR #3933 can add its own separate changelog entry under the same version. |
Hi! Picking up #3931.
EventClient.bulkPush(type, inputs, options)silently droppedoptions.priorityandoptions.scope. The per-event mapping only read those fields from each input, and never fell back to the sharedoptionsargument.additionalMetadataalready falls back tooptions.additionalMetadata, andEventClient.pushreads all three fields directly fromoptions, so the bulk path was the odd one out.Fix mirrors the
additionalMetadatapattern:Per-event overrides still win, and the shared options apply to every event in the batch that doesn't set its own.
Testing
Added a unit test that covers both paths: an event with no per-event override picks up the shared option, an event with a per-event override keeps its own.
Closes #3931