Skip to content

Async Function Calling #13901

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
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()

@yakovmanshin yakovmanshin force-pushed the async-function-calling branch from ff350ee to 1f39374 Compare October 25, 2024 12:59
* 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 force-pushed the async-function-calling branch from 1f39374 to d77a97d Compare October 29, 2024 17:10
@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
@firebase firebase locked and limited conversation to collaborators Nov 29, 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