-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Storage async await #8289
Storage async await #8289
Conversation
Coverage ReportAffected SDKsNo changes between base commit (d550a72) and head commit (2bffe65). Test Logs
|
4007610
to
ffdbc7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really neat! 😎
96d60a6
to
8235e4d
Compare
API change is now approved. The PR is ready for final review and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough review @ncooke3 . Lots of good catches! 💯
FirebaseStorageSwift/Tests/Integration/StorageIntegrationCommon.swift
Outdated
Show resolved
Hide resolved
8235e4d
to
f8acfda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Storage Integration Tests are converted to async/await and four new APIs are added to cover cases that don't get an automatic Xcode conversion.
If you want to experiment, the test infra is green here.
Xcode 13+ automatically converts Objective C APIs that return void and take a completion block parameter to an additional async API.
Googlers can see the API proposal at go/firebase-storage-async-await1. An excerpt follows:
The automatic API conversions for Storage are shown in Column G of this spreadsheet designed by @peterfriese. Note that the APIs that return a StorageDownloadTask or StorageUploadTask are not converted.
For Storage, Xcode automatically converts the following APIs to async versions as shown here:
The following APIs have completion parameters but do not get an automatic async API generated because they do not have a Void return value:
I implemented the following four APIs (full implementation here) to fill in the gap by providing APIs to do the implementation without the task handle return value:
The functions are renamed to avoid collisions with the existing API.