segmentio / analytics-next

Segment Analytics.js 2.0
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript
MIT License
385 stars 128 forks source link

Retain messageId if exists (allow overriding) #1043

Closed silesky closed 4 months ago

silesky commented 4 months ago

This addresses an inconsistency with analytics-node (new vs old).

There are cases valid use cases where we want the messageId to be overridable, such as deduping.

This ensures backward compatibility with analytics-node by modifying '@segment/analytics-core'. Specifically, the changes prevent the generation of a messageId if it is already set. This adjustment aligns with the behavior outlined in analytics-node's source code here.

While this is a core release, only the node library is affected, as the browser has its own EventFactory atm.

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: 33464cd00170ad7915825a81340a0fc3dc31ea3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | ----------------------- | ----- | | @segment/analytics-core | Patch | | @segment/analytics-node | Minor | | @segment/analytics-next | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR