Skip to content

Fix Firestore failing to return empty results from the local cache #10437

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

Merged
merged 23 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ec6fb99
CHANGELOG.md: added entry
dconeybe Nov 1, 2022
780bf5d
CHANGELOG.md: update PR number
dconeybe Nov 1, 2022
e8f6a1e
implement the fix; still needs tests though
dconeybe Nov 1, 2022
fd7f544
Merge remote-tracking branch 'origin/master' into FixCacheEmptyResultBug
dconeybe Nov 2, 2022
d5eff09
FSTAPIHelpers.mm: fix build
dconeybe Nov 2, 2022
fcd81da
sync'd spec tests from firebase-js-sdk
dconeybe Nov 2, 2022
60dce81
Revert spec test changes from https://github.com/firebase/firebase-js…
dconeybe Nov 2, 2022
a5d3479
Merge remote-tracking branch 'remotes/origin/dconeybe/SpecTestUpdate'…
dconeybe Nov 2, 2022
48b661a
update spec test changes from https://github.com/firebase/firebase-js…
dconeybe Nov 2, 2022
52eada8
FSTAPIHelpers.mm: use static_cast
dconeybe Nov 2, 2022
0dca899
FIRQuerySnapshotTests.mm: fix build
dconeybe Nov 2, 2022
106984f
FSTAPIHelpers.h: update signature of FSTTestQuerySnapshot, which was …
dconeybe Nov 2, 2022
cacc0f4
FSTAPIHelpers.mm: add missing }
dconeybe Nov 2, 2022
da25007
Merge remote-tracking branch 'origin/master' into FixCacheEmptyResultBug
dconeybe Nov 2, 2022
4a0ca95
Merge remote-tracking branch 'origin/master' into FixCacheEmptyResultBug
dconeybe Nov 2, 2022
0590461
sync_engine.cc: fix InitializeViewAndComputeSnapshot to use the resum…
dconeybe Nov 2, 2022
d602546
Merge remote-tracking branch 'origin/master' into FixCacheEmptyResultBug
dconeybe Nov 3, 2022
4879952
FIRQueryTests.mm: add integration tests testQueriesCanRaiseInitialSna…
dconeybe Nov 3, 2022
eaf96c4
remote_event.h: remove superfluous `explicit` qualifier to the Target…
dconeybe Nov 3, 2022
35e7da1
view_snapshot.cc: modify operator== and Hash() to account for hasCach…
dconeybe Nov 3, 2022
69ba0c2
Merge remote-tracking branch 'origin/master' into FixCacheEmptyResultBug
dconeybe Nov 3, 2022
e364967
FSTAPIHelpers.mm: format code
dconeybe Nov 3, 2022
0031a6a
Merge remote-tracking branch 'origin/master' into FixCacheEmptyResultBug
dconeybe Nov 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased
- [fixed] Fix Firestore failing to raise initial snapshot from empty local cache
result (#10437).

# 10.0.0
- [feature] Added `Query.count()`, which fetches the number of documents in the
result set without actually downloading the documents (#10246).
Expand Down
6 changes: 4 additions & 2 deletions Firestore/Example/Tests/API/FSTAPIHelpers.mm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
NSDictionary<NSString *, NSDictionary<NSString *, id> *> *oldDocs,
NSDictionary<NSString *, NSDictionary<NSString *, id> *> *docsToAdd,
BOOL hasPendingWrites,
BOOL fromCache) {
BOOL fromCache,
BOOL hasCachedResults) {
FSTUserDataReader *reader = FSTTestUserDataReader();

SnapshotMetadata metadata(hasPendingWrites, fromCache);
Expand Down Expand Up @@ -154,7 +155,8 @@
mutatedKeys,
static_cast<bool>(fromCache),
/*sync_state_changed=*/true,
/*excludes_metadata_changes=*/false};
/*excludes_metadata_changes=*/false,
hasCachedResults ? true : false};
return [[FIRQuerySnapshot alloc] initWithFirestore:FSTTestFirestore().wrapped
originalQuery:Query(path)
snapshot:std::move(viewSnapshot)
Expand Down
Loading