-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix race condition where checkin is not reset properly when app first installed #8513
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
Conversation
Coverage ReportAffected SDKs
Test Logs
|
|
Please take a look at the watchOS CI failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please provide a bit more info on how the race condition occurs and causes the issue as well as how the changes fix it?
Is it possible to add a tests that triggers the race condition with the old code and succeeds with the changes?
|
@maksymmalyhin When detect newly install, client try to delete previous checkin from keychain. However, the reset function is in checkinStore class, but when we sent token request, we still load the cache value from authService class. These classes are added from the refactor when we try to remove IID dependency. So we let authService completely own checkinStore and handle the proper reset from authService class. |
|
@maksymmalyhin We had deleteToken Swift API call in place, however, this case is not 100% reproducible and also it only happens during newly installed app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation. LGTM on CI green.
|
@chliangGoogle Does this mean that the race condition is between these two threads of execution? |
|
@spundun That is correct. |
This fixes #8491.
There's a race condition when checkin sometimes not reset properly during app first install, then delete token request contains an old chekcin that causes token is not deleted properly.