Skip to content

[BUG][Typescript SDK] EventClient.bulkPush silently drops options.priority and options.scope #3931

@WipeAir

Description

@WipeAir

Describe the issue
EventClient.bulkPush(type, inputs, options) silently drops options.priority and options.scope. The implementation reads priority and scope only from each per-input EventWithMetadata entry and never falls back to the options argument. options.additionalMetadata is honored as a per-input fallback, but the other two fields in the same PushEventOptions shape are not, which is inconsistent with EventClient.push.

Environment

  • SDK: TypeScript v1.22.1

Expected behavior
When options.priority or options.scope is provided to bulkPush, the value should be applied to every event in the batch that does not set its own override, mirroring how push applies the same options to a single event. At minimum the inconsistency should be documented on PushEventOptions and EventClient.bulkPush.

Code to Reproduce, Logs, or Screenshots

await client.events.bulkPush(
  "user:created",
  [
    { payload: { id: "1" } },
    { payload: { id: "2" } },
  ],
  { priority: 5, scope: "tenant-acme" },
);

The resulting gRPC request contains priority: undefined and scope: undefined for both events. Relevant SDK source:

bulkPush(type, inputs, options = {}) {
  const events = inputs.map((input) => {
    const baseMeta = input.additionalMetadata ?? options.additionalMetadata ?? {};
    // ...
    return {
      // ...
      additionalMetadata: ...,
      priority: input.priority, // options.priority ignored
      scope: input.scope,       // options.scope ignored
    };
  });
}

Compare with push, which reads all three fields directly from options.

Additional context
Workaround: copy options.priority, options.scope, and options.additionalMetadata onto every EventWithMetadata entry on the caller side before invoking bulkPush.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions