Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#431 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
objective-c

调研方向

从 DaysUntilBirthday 示例应用中的 restorePreviousSignIn() 开始,并使用两次调用它的链接更改来重现该问题。按照描述调整 kMinimalTimeToExpire 和 kMinimumRestoredAccessTokenTimeToExpire,测试令牌刷新场景,然后跟踪恢复流程。在重现的场景中两个 completion 块都被调用,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug triage

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:
    https://github.com/google/GoogleSignIn-iOS/commit/01d8cb32d1315cea141feeed5c055c9beb912561
  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

主要语言
Objective-C
星标
751
派生
282
平均合并
4 天 20 小时
30 天内合并 PR
11

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/GoogleSignIn-iOS 的其他 Issue

查看 google/GoogleSignIn-iOS 的全部 Issue

相似的 Issue

更多 Objective-C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。