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

Fixed DispatchGroup’s Excessive Wait in FunctionsContext #13887

Merged

Conversation

yakovmanshin
Copy link
Contributor

  • FunctionsContextProvider.getContext(options:_:) calls AppCheckInterop.getLimitedUseToken(completion:), an optional protocol method
  • When the method is not implemented, its completion handler doesn’t get called
  • This closure is responsible for leaving the dispatch group, and when it’s not called, the group waits longer than needed
  • This change introduces an explicit check for whether the method is implemented
  • It also adds a test which makes sure the method doesn’t exceed the .1s time limit

* `FunctionsContextProvider.getContext(options:_:)` calls `AppCheckInterop.getLimitedUseToken(completion:)`, an *optional* protocol method
* When the method is not implemented, its completion handler doesn’t get called
* This closure is responsible for leaving the dispatch group, and when it’s not called, the group waits longer than needed
* This change introduces an explicit check for whether the method is implemented
* It also adds a test which makes sure the method doesn’t exceed the .1s time limit
@ncooke3 ncooke3 self-assigned this Oct 14, 2024
Copy link
Member

@ncooke3 ncooke3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, nice find!

@paulb777 paulb777 merged commit 84f28c1 into firebase:main Oct 14, 2024
38 checks passed
@yakovmanshin yakovmanshin deleted the functions-optional-protocol-method branch October 14, 2024 15:16
MojtabaHs pushed a commit to MojtabaHs/firebase-ios-sdk that referenced this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants