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

GIDSignIn.sharedInstance.restorePreviousSignIn() sometimes fails to invoke completion handler #431

Open
jonmindtrip opened this issue May 29, 2024 · 0 comments
Labels
bug Something isn't working triage Issues that need to be triaged

Comments

@jonmindtrip
Copy link

Describe the bug
GIDSignIn.sharedInstance.restorePreviousSignIn() does not always invoke the completion handler.

I suspect these two closed issues may have the same root cause:

To Reproduce
There appears to be two requirements to reproduce this:

  • restorePreviousSignIn() must be invoked multiple times before the first call completes
  • the tokens must be close enough to expiring to trigger refresh logic

Specific repro steps:

  1. Make local changes to DaysUntilBirthday sample app such that restorePreviousSignIn() is invoked twice - see:
    01d8cb3
  2. Sign in
  3. Kill and restart the app. Check console: should see output below, indicating that both completion blocks are invoked:
    0: Restoring
    1: Restoring
    0: Done: Optional(<GIDGoogleUser: 0x600002124820>), nil
    1: Done: Optional(<GIDGoogleUser: 0x600002124820>), nil
  4. Kill the app and wait for about an hour. I was also able to reproduce immediately by changing kMinimalTimeToExpire and kMinimumRestoredAccessTokenTimeToExpire to both be 60.0*59.9.
  5. Restart the app and check console output.

Expected behavior
console output should be the following, indicating that both completion blocks were invoked:
0: Restoring
1: Restoring
0: Done: Optional(<GIDGoogleUser: 0x600002124820>), nil
1: Done: Optional(<GIDGoogleUser: 0x600002124820>), nil

Actual behavior
console output is the following, indicating the first completion block was not invoked:
0: Restoring
1: Restoring
1: Done: Optional(<GIDGoogleUser: 0x600002124820>), nil

@jonmindtrip jonmindtrip added bug Something isn't working triage Issues that need to be triaged labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issues that need to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant