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

extremely rare race condition in identify function can slightly degrade data consistency #36

Closed
reinpk opened this issue Aug 1, 2013 · 4 comments
Labels

Comments

@reinpk
Copy link
Contributor

reinpk commented Aug 1, 2013

Instead of serialQueue, pass it the userId in to the enqueueAction method: https://github.com/segmentio/analytics-ios/blob/master/Analytics/Analytics/Source/Segmentio/Segmentio.m#L140-L142

@tonyxiao
Copy link
Contributor

What's the correct behavior here? If we look at https://github.com/segmentio/analytics-ios/blob/dev/Analytics/Providers/Segmentio/SegmentioProvider.m#L158 , it seems that the intention is we should always send the most up to date userId regardless of what the userID might have been when track: is called, which is why we don't set the userID and sessionID on the payload until we are inside the serialQueue, however the identify function at https://github.com/segmentio/analytics-ios/blob/dev/Analytics/Providers/Segmentio/SegmentioProvider.m#L103 seems to defeat the above mechanism by setting self.userID also inside the serialQueue. Since they contradict each other, the natural question is what should the correct behavior be?

@reinpk
Copy link
Contributor Author

reinpk commented Aug 20, 2013

oh man. i'm totally not sure. let's hold on this issue until we can talk to the mailbox guys again. i've completely forgotten what the bad scenario was :P

@tonyxiao
Copy link
Contributor

tonyxiao commented Sep 2, 2013

Do we have a better idea what is the desired behavior?

@tonyxiao
Copy link
Contributor

tonyxiao commented Sep 5, 2013

Ok desired behavior is that identify calls shouldn't affect track calls currently in the queue. Solved and closing.

@tonyxiao tonyxiao closed this as completed Sep 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants