firebase-js-sdk
firebase-js-sdk copied to clipboard
Fix Firestore failing to return empty results from the local cache
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:
https://github.com/firebase/firebase-js-sdk/blob/4ddf5566ca52b1f9ef776dd647c7d514e3b3f9f5/packages/firestore/src/core/event_manager.ts#L374-L375 where it
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 resume token for the query to indicate that the empty result set is cached data and should be raised to the client.
Fixed #5873
⚠️ No Changeset found
Latest commit: dfb45ad40205fcc0f616ce3d53b17792ffd489aa
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Size Analysis Report 1
Affected Products
@firebase/firestoreenableMultiTabIndexedDbPersistenceSize
Type Base (e35db6f) Merge (3ef2847) Diff size 206 kB 207 kB +349 B (+0.2%) size-with-ext-deps 266 kB 267 kB +349 B (+0.1%) getDocSize
Type Base (e35db6f) Merge (3ef2847) Diff size 132 kB 133 kB +362 B (+0.3%) size-with-ext-deps 192 kB 192 kB +362 B (+0.2%) getDocFromServerSize
Type Base (e35db6f) Merge (3ef2847) Diff size 132 kB 133 kB +362 B (+0.3%) size-with-ext-deps 192 kB 192 kB +362 B (+0.2%) getDocsSize
Type Base (e35db6f) Merge (3ef2847) Diff size 134 kB 134 kB +362 B (+0.3%) size-with-ext-deps 193 kB 194 kB +362 B (+0.2%) getDocsFromCacheSize
Type Base (e35db6f) Merge (3ef2847) Diff size 96.3 kB 96.6 kB +309 B (+0.3%) size-with-ext-deps 155 kB 156 kB +309 B (+0.2%) getDocsFromServerSize
Type Base (e35db6f) Merge (3ef2847) Diff size 134 kB 134 kB +362 B (+0.3%) size-with-ext-deps 193 kB 194 kB +362 B (+0.2%) onSnapshotSize
Type Base (e35db6f) Merge (3ef2847) Diff size 134 kB 135 kB +362 B (+0.3%) size-with-ext-deps 194 kB 194 kB +362 B (+0.2%) onSnapshotsInSyncSize
Type Base (e35db6f) Merge (3ef2847) Diff size 124 kB 124 kB +314 B (+0.3%) size-with-ext-deps 183 kB 184 kB +314 B (+0.2%)
Test Logs
Closing since this PR was obsoleted by https://github.com/firebase/firebase-js-sdk/pull/6624