[go: nahoru, domu]

Skip to content
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

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
Prev Previous commit
Next Next commit
fix spec tests in listen_spec.test.ts and recovery_spec.test.ts
  • Loading branch information
dconeybe committed Sep 23, 2022
commit 2e388bc0bddca6d3a3486d50cd3a78912cea9c20
29 changes: 16 additions & 13 deletions packages/firestore/test/unit/specs/listen_spec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,20 @@ describeSpec('Listens:', [], () => {
// us up to docAV2 since that's the last relevant change to the query
// (the document falls out) and send us a snapshot that's ahead of
// docAv3 (which is already in our cache).
.userListens(visibleQuery, { resumeToken: 'resume-token-4000' })
// .watchAcks(visibleQuery)
// .watchSends({ removed: [visibleQuery] }, docAv2)
// .watchCurrents(visibleQuery, 'resume-token-5000')
// .watchSnapshots(5000)
// .expectEvents(visibleQuery, { fromCache: false })
// .userUnlistens(visibleQuery)
// .watchRemoves(visibleQuery)
// // Listen to allQuery again and make sure we still get docAv3.
// .userListens(allQuery, { resumeToken: 'resume-token-4000' })
// .expectEvents(allQuery, { added: [docAv3], fromCache: true })
// .watchAcksFull(allQuery, 6000)
// .expectEvents(allQuery, { fromCache: false })
.userListens(visibleQuery, { resumeToken: 'resume-token-1000' })
.expectEvents(visibleQuery, { fromCache: true })
.watchAcks(visibleQuery)
.watchSends({ removed: [visibleQuery] }, docAv2)
.watchCurrents(visibleQuery, 'resume-token-5000')
.watchSnapshots(5000)
.expectEvents(visibleQuery, { fromCache: false })
.userUnlistens(visibleQuery)
.watchRemoves(visibleQuery)
// Listen to allQuery again and make sure we still get docAv3.
.userListens(allQuery, { resumeToken: 'resume-token-4000' })
.expectEvents(allQuery, { added: [docAv3], fromCache: true })
.watchAcksFull(allQuery, 6000)
.expectEvents(allQuery, { fromCache: false })
);
});

Expand Down Expand Up @@ -396,6 +397,7 @@ describeSpec('Listens:', [], () => {
// (the document falls out) and send us a snapshot that's ahead of
// docAv3 (which is already in our cache).
.userListens(visibleQuery, { resumeToken: 'resume-token-1000' })
.expectEvents(visibleQuery, { fromCache: true })
.watchAcks(visibleQuery)
.watchSends({ removed: [visibleQuery] }, docAv2)
.watchCurrents(visibleQuery, 'resume-token-5000')
Expand All @@ -405,6 +407,7 @@ describeSpec('Listens:', [], () => {
.watchRemoves(visibleQuery)
// Listen to allQuery again and make sure we still get no docs.
.userListens(allQuery, { resumeToken: 'resume-token-4000' })
.expectEvents(allQuery, { fromCache: true })
.watchAcksFull(allQuery, 6000)
.expectEvents(allQuery, { fromCache: false })
);
Expand Down
1 change: 1 addition & 0 deletions packages/firestore/test/unit/specs/recovery_spec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ describeSpec('Persistence Recovery', ['no-ios', 'no-android'], () => {
.userUnlistens(query1)
// No event since the document was removed
.userListens(query1, { resumeToken: 'resume-token-1000' })
.expectEvents(query1, { fromCache: true })
);
}
);
Expand Down