segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
354 stars 181 forks source link

Braze plugin does not successfully de-duplicate Identify calls #907

Closed Jack-Gill-TH closed 3 months ago

Jack-Gill-TH commented 6 months ago

Steps to reproduce Make an initial call to identify with a specific set of traits Make a second call to identify with the same set of traits

Expected behavior Identify is not forwarded to braze

Actual behavior Identify is forwarded to braze


This is because the code that checks for a duplicate payload just performs a referential equality on the two traits objects: https://github.com/segmentio/analytics-react-native/blob/0a79010b847bd36579757442aad56242f816bdae/packages/plugins/plugin-braze/src/BrazePlugin.tsx#L92

I think it's fairly unlikely that this code will be called each time with the same object reference, so this should be updated to perform some kind of deep equality.

oscb commented 3 months ago

Closing. Fix is released in v0.6.1