Skip to content

Commit d73e041

Browse files
committed
resolve comments
1 parent 744d337 commit d73e041

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/firestore/src/local/target_data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class TargetData {
7171
* The number of documents that last matched the query at the resume token or
7272
* read time.
7373
*/
74-
readonly expectedCount: number = 0
74+
readonly expectedCount: number | null = null
7575
) {}
7676

7777
/** Creates a new target data instance with an updated sequence number. */
@@ -104,7 +104,7 @@ export class TargetData {
104104
snapshotVersion,
105105
this.lastLimboFreeSnapshotVersion,
106106
resumeToken,
107-
this.expectedCount
107+
/** expectedCount= */ null
108108
);
109109
}
110110

packages/firestore/src/remote/serializer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ export function toTarget(
10121012

10131013
if (targetData.resumeToken.approximateByteSize() > 0) {
10141014
result.resumeToken = toBytes(serializer, targetData.resumeToken);
1015-
result.expectedCount = targetData.expectedCount;
1015+
result.expectedCount = targetData.expectedCount ?? undefined;
10161016
} else if (targetData.snapshotVersion.compareTo(SnapshotVersion.min()) > 0) {
10171017
// TODO(wuandy): Consider removing above check because it is most likely true.
10181018
// Right now, many tests depend on this behaviour though (leaving min() out
@@ -1021,7 +1021,7 @@ export function toTarget(
10211021
serializer,
10221022
targetData.snapshotVersion.toTimestamp()
10231023
);
1024-
result.expectedCount = targetData.expectedCount;
1024+
result.expectedCount = targetData.expectedCount ?? undefined;
10251025
}
10261026

10271027
return result;

packages/firestore/test/unit/remote/serializer.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ export function serializerTest(
17791779
},
17801780
resumeToken: new Uint8Array([1, 2, 3]),
17811781
targetId: 1,
1782-
expectedCount: 0
1782+
expectedCount: undefined
17831783
};
17841784
expect(result).to.deep.equal(expected);
17851785
});

0 commit comments

Comments
 (0)