-
Notifications
You must be signed in to change notification settings - Fork 875
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
WriteBatch.commit cannot be used in a sync way #2822
Labels
Comments
I found a few problems with this issue:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using
.set
,.update
onDocumentReference
, we can directly do a.get
after without risking invalid data in the "local database".But since
WriteBatch.commit
is written as anAsyncFunction
, it defers the commit to the "local database" to the next event loop.I'm not sure wherever the original use case is supported, but it'd be great to have consistency between those methods. I've spent some time debugging a timing issue in my React application with a code like (where the
navigate
cause a read-sync in and use a suspense firestore cache):While it'll work with:
The text was updated successfully, but these errors were encountered: