File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
packages/firestore/src/model Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -410,9 +410,10 @@ function applySetMutationToLocalView(
410
410
document : MutableDocument ,
411
411
localWriteTime : Timestamp
412
412
) : void {
413
- if ( ! preconditionIsValidForDocument ( mutation . precondition , document ) ) {
414
- return ;
415
- }
413
+ debugAssert (
414
+ mutation . precondition . isNone ,
415
+ 'SetMutations should not have preconditions outside of Transactions'
416
+ ) ;
416
417
417
418
const newData = mutation . value . clone ( ) ;
418
419
const transformResults = localTransformResults (
@@ -625,12 +626,14 @@ function applyDeleteMutationToLocalView(
625
626
document . key . isEqual ( mutation . key ) ,
626
627
'Can only apply mutation to document with same key'
627
628
) ;
629
+ debugAssert (
630
+ mutation . precondition . isNone ,
631
+ 'DeleteMutions should not have preconditions outside of Transactions'
632
+ ) ;
628
633
629
- if ( preconditionIsValidForDocument ( mutation . precondition , document ) ) {
630
- // We don't call `setHasLocalMutations()` since we want to be backwards
631
- // compatible with the existing SDK behavior.
632
- document . convertToNoDocument ( SnapshotVersion . min ( ) ) ;
633
- }
634
+ // We don't call `setHasLocalMutations()` since we want to be backwards
635
+ // compatible with the existing SDK behavior.
636
+ document . convertToNoDocument ( SnapshotVersion . min ( ) ) ;
634
637
}
635
638
636
639
/**
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ export class ObjectValue {
185
185
) : { mapValue : ProtoMapValue } | null {
186
186
let modified = false ;
187
187
188
- const existingValue = this . extractNestedValue (
188
+ const existingValue = ObjectValue . extractNestedValue (
189
189
this . partialValue ,
190
190
currentPath
191
191
) ;
You can’t perform that action at this time.
0 commit comments