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

Async Function Calling #13901

Merged
merged 2 commits into from
Oct 29, 2024
Merged

Conversation

yakovmanshin
Copy link
Contributor

  • Introduced an async / await version of callFunction which takes advantage of FunctionsContextProvider’s async context(options:)
  • Refactored GTMSessionFetcher setup to minimize code duplication
  • Added tests

@yakovmanshin
Copy link
Contributor Author

yakovmanshin commented Oct 24, 2024

TODO: Integration tests are failing:

IntegrationTests.testCallAsFunction()
IntegrationTests.testExplicitErrorAsync()
IntegrationTests.testExplicitErrorAsync()
IntegrationTests.testExplicitErrorAsync()
IntegrationTests.testExplicitErrorAsync()
IntegrationTests.testThrowErrorAsync()
IntegrationTests.testUnknownErrorAsync()
IntegrationTests.testUnknownErrorAsync()

* Introduced an async / await version of `callFunction` which takes advantage of `FunctionsContextProvider`’s async `context(options:)`
* Refactored `GTMSessionFetcher` setup to minimize code duplication
* Added tests
* `GTMSessionFetcher`’s async `beginFetch()` method returns either data or error, but not both (unlike the completion-handler variant)
* Without the data, `processedResponseData(from:error:)` has less details and can’t categorize the error correctly
* However, the same details can be retrieved from the error’s user info
@yakovmanshin yakovmanshin marked this pull request as ready for review October 29, 2024 17:13
@ncooke3 ncooke3 merged commit 0ac8bbb into firebase:main Oct 29, 2024
38 checks passed
@yakovmanshin yakovmanshin deleted the async-function-calling branch October 29, 2024 23:25
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