Skip to content

Commit

Permalink
Start by always sending an invalidation event.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkistner committed Feb 6, 2025
1 parent bfbcdd3 commit 0368e19
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,19 @@ export class MongoBucketStorage
lastWriteCheckpoint = currentWriteCheckpoint;
lastCheckpoint = checkpoint;

const syncRules = bucketStorage.getParsedSyncRules(options.parseOptions);

// We do not track individual bucket updates yet, always send an invalidation event.
filter?.({
syncRules,
invalidate: true
});

yield {
base: cp,
writeCheckpoint: currentWriteCheckpoint,
storage: bucketStorage,
syncRules: bucketStorage.getParsedSyncRules(options.parseOptions)
syncRules
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export class PostgresBucketStorageFactory
let lastCheckpoint: utils.OpId | null = null;
let lastWriteCheckpoint: bigint | null = null;

const { signal, user_id, parseOptions } = options;
const { signal, user_id, parseOptions, filter } = options;

const iter = wrapWithAbort(this.sharedIterator, signal);
for await (const cp of iter) {
Expand Down Expand Up @@ -433,6 +433,12 @@ export class PostgresBucketStorageFactory
lastWriteCheckpoint = currentWriteCheckpoint;
lastCheckpoint = checkpoint;

// We do not track individual bucket updates yet, always send an invalidation event.
filter?.({
syncRules,
invalidate: true
});

yield { base: cp, writeCheckpoint: currentWriteCheckpoint, syncRules, storage: bucketStorage };
}
}
Expand Down

0 comments on commit 0368e19

Please sign in to comment.