Skip to content

Commit 7a6cff1

Browse files
committed
Use a Symbol instead of null for INVALIDATE_ALL_BUCKETS.
1 parent 66fed0f commit 7a6cff1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/service-core/src/sync/BucketChecksumState.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class BucketChecksumState {
9191
}
9292

9393
let checksumMap: util.ChecksumMap;
94-
if (updatedBuckets != null) {
94+
if (updatedBuckets != INVALIDATE_ALL_BUCKETS) {
9595
if (this.lastChecksums == null) {
9696
throw new ServiceAssertionError(`Bucket diff received without existing checksums`);
9797
}
@@ -251,6 +251,8 @@ export class BucketChecksumState {
251251
}
252252
}
253253

254+
const INVALIDATE_ALL_BUCKETS = Symbol('INVALIDATE_ALL_BUCKETS');
255+
254256
export interface CheckpointUpdate {
255257
/**
256258
* All buckets forming part of the checkpoint.
@@ -262,7 +264,7 @@ export interface CheckpointUpdate {
262264
*
263265
* If null, assume that any bucket in `buckets` may have been updated.
264266
*/
265-
updatedBuckets: Set<string> | null;
267+
updatedBuckets: Set<string> | typeof INVALIDATE_ALL_BUCKETS;
266268
}
267269

268270
export class BucketParameterState {
@@ -330,7 +332,7 @@ export class BucketParameterState {
330332
if (update.invalidateDataBuckets) {
331333
return {
332334
buckets: querier.staticBuckets,
333-
updatedBuckets: null
335+
updatedBuckets: INVALIDATE_ALL_BUCKETS
334336
};
335337
}
336338

@@ -397,7 +399,7 @@ export class BucketParameterState {
397399
return {
398400
buckets: allBuckets,
399401
// We cannot track individual bucket updates for dynamic lookups yet
400-
updatedBuckets: null
402+
updatedBuckets: INVALIDATE_ALL_BUCKETS
401403
};
402404
} else {
403405
return {

0 commit comments

Comments
 (0)