google / google/GoogleSignIn-iOS

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

Đang mở
#431 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug triage
Ngôn ngữ chính
Objective-C
Star
750
Fork
282
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
9

Mô tả

**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:
* https://github.com/google/GoogleSignIn-iOS/issues/360
* https://github.com/google/GoogleSignIn-iOS/issues/378

**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:
https://github.com/google/GoogleSignIn-iOS/commit/01d8cb32d1315cea141feeed5c055c9beb912561
1. Sign in
1. 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(), nil
1: Done: Optional(), nil
1. 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.
1. 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(), nil
1: Done: Optional(), nil

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.