-
Notifications
You must be signed in to change notification settings - Fork 897
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
Fix Firestore failing to return empty results from the local cache #6624
Conversation
🦋 Changeset detectedLatest commit: 3e1495b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (180,142 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
Please add a changeset so an entry will be included in the release notes. |
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.
A few small comments. Also, I added a couple of spec tests. I don't think you need to learn how to write spec tests at this point (you'll definitely have chances later!).
I just realized that I had forgotten to push up my changes that add two spec tests. I've now pushed them up in f06eb5f |
Please add a changeset so an entry will be included in the release notes. |
Bump |
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.
I've asked @wu-hui to look at the spec tests tomorrow. Other than that, mostly LGTM (other than my 2 other comments).
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.
The multi-tab spec tests look good. Also this seems to be a clever fix!
I do wonder if we should avoid passing |
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.
Awesome job! Thanks!
… fix for its issue isn't fixed yet (it will be fixed by #10437)
Fix a bug where Firestore fails to return results from the local cache if the result set was empty.
This bug is due to the following logic in
event_manager.ts
:firebase-js-sdk/packages/firestore/src/core/event_manager.ts
Lines 374 to 375 in 4ddf556
which assumes that if the result set from the local cache is empty that there is no cached result; however, if the result set of the query is indeed empty then it should be returning that empty result set from the cache.
This fix improves the logic to use the presence of a hasCachedResults flag to indicate that the empty result set is cached data and should be raised to the client.
Fixed #5873