-
Notifications
You must be signed in to change notification settings - Fork 938
Schedule everything on the AsyncQueue #3701
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
Conversation
💥 No ChangesetLatest commit: 94c0d82 Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs |
@@ -325,7 +337,7 @@ export function terminate( | |||
} | |||
|
|||
function verifyNotInitialized(firestore: Firestore): void { | |||
if (firestore._initialized) { | |||
if (firestore._initialized || firestore._terminated) { |
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.
Question: what's the reason to check for _terminated
? Can an instance be terminated without being initialized? If yes, consider adding this bit to the error message below.
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.
If a user calls "terminate()" on an uninitialized Firestore, we should also not initialize it. The error message is actually shared between the new SDK and the old SDK and hence, I would rather not touch it.
This PR fixes a scheduling problem in the firestore-exp client. Before this change, most methods looked like this:
That meant that
getComponent()
did not run on the AsyncQueue. During a test I noticed that the following did not issue a write:This was because
terminate
did not usegetComponent()
and hence was able to schedule its task on the async queue beforesetDoc()
.This is a large PR but I am out next week so take your time :)