File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
packages/firestore/test/unit/local Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ function genericRemoteDocumentCacheTests(
360
360
] ,
361
361
version ( 3 )
362
362
) ;
363
- await cache . removeEntry ( key ( 'a/2' ) ) ;
363
+ await cache . removeEntry ( key ( 'a/2' ) , version ( 4 ) ) ;
364
364
365
365
const changedDocs = await cache . getNewDocumentChanges ( ) ;
366
366
assertMatches (
Original file line number Diff line number Diff line change @@ -76,14 +76,19 @@ export class TestRemoteDocumentCache {
76
76
return this . addEntries ( [ maybeDocument ] , maybeDocument . version ) ;
77
77
}
78
78
79
- removeEntry ( documentKey : DocumentKey ) : Promise < void > {
79
+ removeEntry (
80
+ documentKey : DocumentKey ,
81
+ version ?: SnapshotVersion
82
+ ) : Promise < void > {
80
83
return this . persistence . runTransaction (
81
84
'removeEntry' ,
82
85
'readwrite-primary' ,
83
86
txn => {
84
- const changeBuffer = this . newChangeBuffer ( ) ;
87
+ const changeBuffer = this . newChangeBuffer (
88
+ version ? { trackRemovals : true } : undefined
89
+ ) ;
85
90
return changeBuffer . getEntry ( txn , documentKey ) . next ( ( ) => {
86
- changeBuffer . removeEntry ( documentKey ) ;
91
+ changeBuffer . removeEntry ( documentKey , version ) ;
87
92
return changeBuffer . apply ( txn ) ;
88
93
} ) ;
89
94
}
@@ -128,7 +133,9 @@ export class TestRemoteDocumentCache {
128
133
) ;
129
134
}
130
135
131
- newChangeBuffer ( ) : RemoteDocumentChangeBuffer {
132
- return this . cache . newChangeBuffer ( ) ;
136
+ newChangeBuffer ( options ?: {
137
+ trackRemovals : boolean ;
138
+ } ) : RemoteDocumentChangeBuffer {
139
+ return this . cache . newChangeBuffer ( options ) ;
133
140
}
134
141
}
You can’t perform that action at this time.
0 commit comments