-
Notifications
You must be signed in to change notification settings - Fork 428
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
FR: Firestore.SetAsync() should taken a Cancellation Token similar to Storage methods. #907
Comments
Thank you for this feature request, @jonahgoldsaito. I'm actually working on adding The 4 methods that are planned to gain a
As for the "dangling"
you're almost certainly correct that it was copied from the Storage quickstart app and never wired in (because there is nothing to wire it into). I'll make a note to clean it up as part of my work on Firestore's CancellationToken parameter.
If we ever change the implementation of Firestore to natively support the concept of "cancellation" then we will revisit adding Note to Googlers: This feature is being tracked in b/159752361. |
Thanks @dconeybe so much for clearing all that up. If I were to do a |
In that case it would actually do the "set", but only because transactions do not influence calls to In a transaction, instead of calling https://firebase.google.com/docs/reference/unity/class/firebase/firestore/transaction |
Again, thank you for taking the time! You rock 🤘 |
Feature proposal
Firestore should have a flavor of the
SetAsync()
call that can accept a cancellationToken, ideally similar to Storage's counterparts, likePutFileAsync()
.SetAsync( object documentData, SetOptions options, CancellationToken cancelToken )
Though a Firestore Get/Set/Update operation is usually quite quick, I've had times where there is some waiting because of spotty internet connections, or which appear to have failed silently (no isFault or cancellation). In these cases, the wait time can potentially be quite long, and a user (or a timeout I set up) should be able to cancel out.
A side note is that within the quickstart-unity project, the Firestore example is set up with the same structure as Storage, with a cancellationTokenSource. But within the Storage example, the cancellationTokenSource.Cancel() is connected to the Task generated by the Storage API call, but in Firestore there is a similar cancellationTokenSource but without anything in the SetAsync() to connect it up with. I can't find where it has any effect. And I wouldn't be at all surprised if I'm missing something clever 😅
The text was updated successfully, but these errors were encountered: