engage-so / engage-js

Engage JS SDK
1 stars 0 forks source link

Duplicate customer after simultaneous request with same id #2

Open adexot opened 2 years ago

adexot commented 2 years ago

I see duplicate customer with the same id when I make a simultaneous call with addAttribute and track methods.

Screenshot 2022-06-26 at 12 02 46

One thing to note is that the identify call was not made for the customer creation on engage. The duplicate customer data should ideally be one, since the call is made to the same id.

kehers commented 2 years ago

@adexot

Thanks for discovering this and sorry about the inconvenience. It is most likely due to race conditions with both calls triggered at the same time. A temporary fix would be to await for each call like this:

await Engage.identify({...})
...
await Engage.track('id', {...})

We will refactor to solve this internally.