Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when calling identify immediately after reset #1034

Open
zenled opened this issue May 26, 2022 · 3 comments
Open

Problem when calling identify immediately after reset #1034

zenled opened this issue May 26, 2022 · 3 comments

Comments

@zenled
Copy link

zenled commented May 26, 2022

When calling identify immediately after calling reset, the userId and traits will not get reset.

Minimal example:

// Swift
Analytics.shared().identify("123", traits: ["firstName": "John", "age":"20"])
Analytics.shared().flush()
Analytics.shared().reset()
Analytics.shared().identify(nil, traits: ["firstName": "David"])
// Segment debugger
IDENTIFY: "traits": {"userId": "123", "firstName": "John", "age": "20"}
IDENTIFY: "traits": {"userId": "123", "firstName": "David", "age": "20" } // userId and traits did not get reset

The first IDENTIFY call works as expected.
In the second IDENTIFY call, I would expect the userId and age to not have a value.

But if I add a delay after the reset it all works as expected.

Analytics.shared().identify("123", traits: ["firstName": "John", "age":"20"])
Analytics.shared().flush()
Analytics.shared().reset()
sleep(2)
Analytics.shared().identify(nil, traits: ["firstName": "David"])
// Segment debugger
IDENTIFY: "traits": {"userId": "123", "firstName": "John", "age": "20"}
IDENTIFY: "traits": {"firstName": "David"}

Library version 4.1.6.

@Laura-Lo
Copy link

Laura-Lo commented Jun 30, 2022

Hi @zenled!
Same is happening to me, did you find any solution apart from applying a delay?

Thanks!!

@zenled
Copy link
Author

zenled commented Jun 30, 2022

@Laura-Lo Unfortunately, I haven't found a solution, I just use a delay.

@Laura-Lo
Copy link

Thanks @zenled!

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

No branches or pull requests

2 participants