analytics-react-native icon indicating copy to clipboard operation
analytics-react-native copied to clipboard

[bugfix] reset anonymousId properly

Open jboteros opened this issue 1 year ago • 2 comments

.reset(true) function had a bad behavior because when is resetting the anonymousId comes form this.state.userInfo instead of this.userInfo, consulting a previous version of the field.

jboteros avatar Nov 15 '23 16:11 jboteros

@jboteros can we get more details on how to repro the issue you are bumping into here?

this.userInfo just maps into this.store.userInfo so in theory it should be the same thing either way. I'm curious if this has fixed your issues and how to repro to understand better what's going on.

oscb avatar Dec 12 '23 20:12 oscb

@jboteros can we get more details on how to repro the issue you are bumping into here?

this.userInfo just maps into this.store.userInfo so in theory it should be the same thing either way. I'm curious if this has fixed your issues and how to repro to understand better what's going on.

Yes, that implementation fix our bug and now we have a proper reset user flow.

Basically the issue was related of the instance of the userInfo because you reset the userInfo in this.state.userInfo but fetch it in this.userInfo (at this point that instance is not update)

For now I created a patch over you package waiting for your fix and update it

BTW if is not clear the bug is related on the reset() and the anonymousID is not reseted properly conserve the same previous one.

Thanks!

jboteros avatar Dec 13 '23 20:12 jboteros

Hi @jboteros apologies but is this still an issue? Oscar is no longer with Segment and I'm just trying to catch up on things here. Thanks!

alanjcharles avatar May 20 '24 18:05 alanjcharles

Raised a PR with updated code PR : https://github.com/segmentio/analytics-react-native/pull/950

hvardhan-unth avatar Jun 03 '24 09:06 hvardhan-unth