Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Calling .reset() forcibly re-identifies the user causing issues with identity merge #258

Closed
JSanchezIO opened this issue Sep 21, 2020 · 2 comments

Comments

@JSanchezIO
Copy link

JSanchezIO commented Sep 21, 2020

Problem

Mixpanel introduced identity merge which allows you to call .identify(SOME_USER_ID) and Mixpanel will then merge the profiles for the id you pass in, in this case, SOME_USER_ID, and the anonymous id of the user prior to identification. This scenario is currently supported by this library. However, signing out causes some issues. This is because on signout Mixpanel recommends calling .reset() to get a new anonymous id for the current user. In this implementation, when we call .reset() we immediately call .identify() with a newly generated id, for ease-of-use. With calling .identify() on .reset() we are implicitly merging the newly generated id with the anonymous id. This causes problems because identity merge will not work on anonymous ids that have been already merged.

Possible Solutions

  • Allow the user to pass a boolean to .reset() to toggle auto-identifying the user
  • Remove auto-identification from .reset()

Mixpanel's Identity Merge Flow

Mixpanel's Identity Merge Flow

@jpalmieri
Copy link

@JSanchezIO I see you closed this issue. Were you able to resolve this, or did you maybe just close it because the library is now deprecated?

@JSanchezIO
Copy link
Author

@jpalmieri I don't recall, the codebase that I was using this in is no longer active. I believe it was because of the PR that was merged to solve this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants