You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Google.Cloud.Firestore 4.3.0's Transaction.GetSnapshotAsync(DocumentReference, CancellationToken) creates a linked CancellationTokenSource in a using block, then returns the asynchronous snapshot task. The linked source is disposed when the method returns, before the read completes, disconnecting later cancellation from the transaction and operation tokens.
The same pattern is present in the transaction's document-list, query, and aggregate-query snapshot methods, including on the current main branch.
To reproduce deterministically, use a fake FirestoreClient whose BeginTransactionAsync succeeds and whose BatchGetDocuments stream remains pending with a registration on CallSettings.CancellationToken. Begin a transaction with a caller cancellation token, start transaction.GetSnapshotAsync(document, callerToken), wait until the stream is pending, then cancel the caller token. The native read token remains uncanceled and the read stays pending. Passing the token to DocumentReference.GetSnapshotAsync directly cancels the pending stream.
Expected: cancellation during a pending transaction snapshot read reaches the native read. The linked token source should remain alive until the snapshot task completes, for example by awaiting the task inside its disposal scope.
The fix has been merged #15963, and will go out in the next weeks regular release. I will close this issue for now and update here again once its released.
Activity
amanda-tarafa commentedon Oct 7, 2026
Thanks for the report, we'll look into it as soon as we are able.
robertvoinescu-work commentedon Oct 7, 2026
The fix has been merged #15963, and will go out in the next weeks regular release. I will close this issue for now and update here again once its released.
robertvoinescu-work commentedon Oct 20, 2026
This has been released: #15970