Skip to content

FR: Firestore.SetAsync() should taken a Cancellation Token similar to Storage methods. #907

Open
@jonahgoldsaito

Description

@jonahgoldsaito

Feature proposal

  • Firebase Component: Firestore

Firestore should have a flavor of the SetAsync() call that can accept a cancellationToken, ideally similar to Storage's counterparts, like PutFileAsync().

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 😅

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions