Skip to content

messageId gets overwritten when set manually on .track calls. #1245

Closed
@julio-poplin

Description

@julio-poplin

Me and my team are running into a situation where we need to take advantage of the deduplication Segment offers using the messageId field, as described in the documentation

https://segment.com/docs/guides/duplicate-data/#99-deduplication

So to achieve this, our paylod looks like this

  const event = {
    messageId: "internalUniqueIdWeControl",
    event: eventType,
    userId,
    properties: {...},
  };

Based off the payload structure showed here, https://segment.com/docs/connections/spec/track/#example where messageId is on the top level of the payload object.

Image

Yet when we call segmentClient.track(event) The messageId always gets overwritten by a library generated messageId that looks something like this: "messageId": "node-next-1741121581880-774db6ae-0dac-4d17-b7d9-785f42d45a68" effectively removing the ability to use the deduplication feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions