Skip to content

Fixed DispatchGroup’s Excessive Wait in FunctionsContext #13887

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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
@firebase firebase locked and limited conversation to collaborators Nov 15, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants