Skip to content

Commit e694ead

Browse files
committed
Disregard NoDocuments when checking against existing document versions.
1 parent fd9de63 commit e694ead

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/firestore/src/local/local_store.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
DocumentMap,
2727
MaybeDocumentMap
2828
} from '../model/collections';
29-
import { MaybeDocument } from '../model/document';
29+
import { MaybeDocument, NoDocument } from '../model/document';
3030
import { DocumentKey } from '../model/document_key';
3131
import { Mutation } from '../model/mutation';
3232
import {
@@ -467,8 +467,13 @@ export class LocalStore {
467467
// cache, though we make an exception for SnapshotVersion.MIN which
468468
// can happen for manufactured events (e.g. in the case of a limbo
469469
// document resolution failing).
470+
//
471+
// Also disregard any existing NoDocument. These documents can have
472+
// synthesized versions based on read times after any actual
473+
// committed version on the server.
470474
if (
471475
existingDoc == null ||
476+
(existingDoc instanceof NoDocument) ||
472477
doc.version.isEqual(SnapshotVersion.MIN) ||
473478
doc.version.compareTo(existingDoc.version) >= 0
474479
) {

0 commit comments

Comments
 (0)