Skip to content

Commit f271609

Browse files
Remove docKey
1 parent 84d6e49 commit f271609

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

packages/firestore/src/local/local_store_impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ function applyWriteToRemoteDocuments(
10351035
'ackVersions should contain every doc in the write.'
10361036
);
10371037
if (doc.version.compareTo(ackVersion!) < 0) {
1038-
batch.applyToRemoteDocument(docKey, doc, batchResult);
1038+
batch.applyToRemoteDocument(doc, batchResult);
10391039
if (doc.isValidDocument()) {
10401040
// We use the commitVersion as the readTime rather than the
10411041
// document's updateTime since the updateTime is not advanced

packages/firestore/src/model/mutation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ export function applyMutationToRemoteDocument(
246246
}
247247

248248
/**
249-
* Applies this mutation to the given document or null for the purposes of
250-
* computing the new local view of a document. If the input document doesn't
251-
* match the expected state, the document is not modified.
249+
* Applies this mutation to the given document for the purposes of computing
250+
* the new local view of a document. If the input document doesn't match the
251+
* expected state, the document is not modified.
252252
*
253253
* @param mutation - The mutation to apply.
254254
* @param document - The document to mutate. The input document can be an

packages/firestore/src/model/mutation_batch.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ export class MutationBatch {
6464

6565
/**
6666
* Applies all the mutations in this MutationBatch to the specified document
67-
* to create a new remote document
67+
* to compute the state of the remote document
6868
*
69-
* @param docKey - The key of the document to apply mutations to.
7069
* @param document - The document to apply mutations to.
7170
* @param batchResult - The result of applying the MutationBatch to the
7271
* backend.
7372
*/
7473
applyToRemoteDocument(
75-
docKey: DocumentKey,
7674
document: MutableDocument,
7775
batchResult: MutationBatchResult
7876
): void {
@@ -86,7 +84,7 @@ export class MutationBatch {
8684

8785
for (let i = 0; i < this.mutations.length; i++) {
8886
const mutation = this.mutations[i];
89-
if (mutation.key.isEqual(docKey)) {
87+
if (mutation.key.isEqual(document.key)) {
9088
const mutationResult = mutationResults[i];
9189
applyMutationToRemoteDocument(mutation, document, mutationResult);
9290
}

0 commit comments

Comments
 (0)