-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #10437
Conversation
Coverage Report 1Affected Products
Test Logs |
… fix for its issue isn't fixed yet (it will be fixed by #10437)
…forgotten in a previous commit
…pshotFromCachedEmptyResults and testQueriesCanRaiseInitialSnapshotFromEmptyDueToDeleteCachedResults
…Change constructor.
Size Report 1Affected ProductsTest Logs |
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.
LGTM!
Thanks for the review, @ehsannas! |
FYI This fix has been incorporated into version 10.2.0 released November 15, 2022 https://firebase.google.com/support/release-notes/ios#version_1020_-_november_15_2022 |
@dconeybe Note that you can mark the fix version in the milestone field of the PR - I'll do this one now ... |
@paulb777 Ahh good to know. I'll use that in the future. |
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
query_listener.cc
:firebase-ios-sdk/Firestore/core/src/core/query_listener.cc
Lines 150 to 151 in a1b78b2
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.
This bug fix is ported from firebase/firebase-js-sdk#6624 and firebase/firebase-android-sdk#4207, which fixed firebase/firebase-js-sdk#5873.