File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,9 @@ export class LocalDocumentsView {
155
155
} )
156
156
. next ( matchingMutationBatches => {
157
157
for ( const batch of matchingMutationBatches ) {
158
- // TODO(mikelehen): PERF: Check if this mutation actually affects the
159
- // query to reduce work.
160
158
for ( const mutation of batch . mutations ) {
161
159
const key = mutation . key ;
162
-
160
+ // Only process documents belonging to the collection.
163
161
if ( ! query . path . isImmediateParentOf ( key . path ) ) {
164
162
continue ;
165
163
}
Original file line number Diff line number Diff line change @@ -154,10 +154,10 @@ export interface MutationQueue extends GarbageSource {
154
154
) : PersistencePromise < MutationBatch [ ] > ;
155
155
156
156
/**
157
- * Finds all mutation batches that could possibly affect the given
158
- * set of document keys. Not all mutations in a batch will necessarily affect
159
- * each key, so when looping through the batch you'll need to
160
- * check that the mutation itself matches the key.
157
+ * Finds all mutation batches that could possibly affect the given set of
158
+ * document keys. Not all mutations in a batch will necessarily affect each
159
+ * key, so when looping through the batch you'll need to check that the
160
+ * mutation itself matches the key.
161
161
*
162
162
* Batches are guaranteed to be in sorted order.
163
163
*
Original file line number Diff line number Diff line change @@ -384,7 +384,6 @@ function genericMutationQueueTests(): void {
384
384
const matches = await mutationQueue . getAllMutationBatchesAffectingDocumentKey (
385
385
key ( 'foo/bar' )
386
386
) ;
387
- expect ( matches . length ) . to . deep . equal ( expected . length ) ;
388
387
expectEqualArrays ( matches , expected ) ;
389
388
} ) ;
390
389
@@ -409,7 +408,6 @@ function genericMutationQueueTests(): void {
409
408
. add ( key ( 'foo/bar' ) )
410
409
. add ( key ( 'foo/baz' ) )
411
410
) ;
412
- expect ( matches . length ) . to . deep . equal ( expected . length ) ;
413
411
expectEqualArrays ( matches , expected ) ;
414
412
} ) ;
415
413
You can’t perform that action at this time.
0 commit comments