File tree Expand file tree Collapse file tree 1 file changed +2
-45
lines changed
modules/module-mongodb-storage/src/storage/implementation Expand file tree Collapse file tree 1 file changed +2
-45
lines changed Original file line number Diff line number Diff line change 99} from '@powersync/lib-services-framework' ;
1010import {
1111 BroadcastIterable ,
12+ CHECKPOINT_INVALIDATE_ALL ,
1213 CheckpointChanges ,
1314 GetCheckpointChangesOptions ,
1415 getLookupBucketDefinitionName ,
@@ -850,50 +851,6 @@ export class MongoSyncBucketStorage
850851 }
851852
852853 async getCheckpointChanges ( options : GetCheckpointChangesOptions ) : Promise < CheckpointChanges > {
853- const dataBuckets = await this . db . bucket_data
854- . find (
855- {
856- '_id.g' : this . group_id ,
857- '_id.o' : { $gt : BigInt ( options . lastCheckpoint ) , $lte : BigInt ( options . nextCheckpoint ) }
858- } ,
859- {
860- projection : {
861- '_id.b' : 1
862- } ,
863- limit : 1001 ,
864- batchSize : 1001 ,
865- singleBatch : true
866- }
867- )
868- . toArray ( ) ;
869- const invalidateDataBuckets = dataBuckets . length > 1000 ;
870-
871- const parameterUpdates = await this . db . bucket_parameters
872- . find (
873- {
874- _id : { $gt : BigInt ( options . lastCheckpoint ) , $lt : BigInt ( options . nextCheckpoint ) } ,
875- 'key.g' : this . group_id
876- } ,
877- {
878- projection : {
879- lookup : 1
880- } ,
881- limit : 1001 ,
882- batchSize : 1001 ,
883- singleBatch : true
884- }
885- )
886- . toArray ( ) ;
887- const invalidateParameterUpdates = parameterUpdates . length > 1000 ;
888-
889- return {
890- invalidateDataBuckets,
891- updatedDataBuckets : invalidateDataBuckets ? [ ] : dataBuckets . map ( ( b ) => b . _id . b ) ,
892-
893- invalidateParameterBuckets : invalidateParameterUpdates ,
894- updatedParameterBucketDefinitions : invalidateParameterUpdates
895- ? [ ]
896- : [ ...new Set < string > ( parameterUpdates . map ( ( p ) => getLookupBucketDefinitionName ( p . lookup ) ) ) ]
897- } ;
854+ return CHECKPOINT_INVALIDATE_ALL ;
898855 }
899856}
You can’t perform that action at this time.
0 commit comments