Skip to content

Commit c05b58c

Browse files
committed
Fix bug: more insertion into immutable data structures.
1 parent c61aec2 commit c05b58c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/firestore/src/local/local_documents_view.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ export class LocalDocumentsView {
227227
);
228228
}
229229
const newSet = documentsByBatchId.get(batch.batchId)!.add(key);
230-
documentsByBatchId.insert(batch.batchId, newSet);
230+
documentsByBatchId = documentsByBatchId.insert(
231+
batch.batchId,
232+
newSet
233+
);
231234
});
232235
});
233236
})

packages/firestore/src/local/local_store_impl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,12 @@ export function localStoreAcknowledgeBatch(
429429
function getKeysWithTransformResults(
430430
batchResult: MutationBatchResult
431431
): DocumentKeySet {
432-
const result = documentKeySet();
432+
let result = documentKeySet();
433433

434434
for (let i = 0; i < batchResult.mutationResults.length; ++i) {
435435
const mutationResult = batchResult.mutationResults[i];
436436
if (mutationResult.transformResults.length > 0) {
437-
result.add(batchResult.batch.mutations[i].key);
437+
result = result.add(batchResult.batch.mutations[i].key);
438438
}
439439
}
440440
return result;

0 commit comments

Comments
 (0)