Skip to content

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

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 20 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
5 changes: 5 additions & 0 deletions .changeset/cool-grapes-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/firestore': patch
---

Fix Firestore failing to raise initial snapshot from empty local cache result
6 changes: 0 additions & 6 deletions packages/firestore/test/unit/specs/listen_spec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1759,14 +1759,9 @@ describeSpec('Listens:', [], () => {
.userListens(query1)
.watchAcksFull(query1, 1000)
.expectEvents(query1, { fromCache: false })
// Query is shared in second client
.client(1)
.expectListen(query1)
.client(0)
.userUnlistens(query1)
.watchRemoves(query1)
.client(1)
.expectUnlisten(query1)
// Re-listen to the query in second client and verify that the empty
// snapshot is raised from cache.
.userListens(query1, { resumeToken: 'resume-token-1000' })
Expand Down Expand Up @@ -1810,7 +1805,6 @@ describeSpec('Listens:', [], () => {
.writeAcks('collection/a', 2000)
.watchAcksFull(query1, 2000, doc1Deleted)
.client(1)
.expectListen(query1, { resumeToken: 'resume-token-2000' })
.expectEvents(query1, { fromCache: false })
);
}
Expand Down
3 changes: 1 addition & 2 deletions repo-scripts/prune-dts/tests/firestore.input.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4988,8 +4988,7 @@ declare class TargetChange {
*/
static createSynthesizedTargetChangeForCurrentChange(
targetId: TargetId,
current: boolean,
resumeToken: ByteString
current: boolean
): TargetChange;
}

Expand Down