Skip to content

Commit 60a1d7f

Browse files
fix
1 parent e0ae870 commit 60a1d7f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

modules/module-mongodb/src/storage/implementation/PersistedBatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class PersistedBatch {
7474

7575
const dchecksum = utils.hashDelete(replicaIdToSubkey(options.table.id, options.sourceKey));
7676

77-
for (let k of options.evaluated) {
77+
for (const k of options.evaluated) {
7878
const key = currentBucketKey(k);
7979
remaining_buckets.delete(key);
8080

modules/module-mongodb/src/storage/implementation/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { storage } from '@powersync/service-core';
22
import { SqliteJsonValue } from '@powersync/service-sync-rules';
33
import * as bson from 'bson';
4+
45
export interface SourceKey {
56
/** group_id */
67
g: number;

modules/module-mongodb/src/storage/implementation/util.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function replicaIdEquals(a: storage.ReplicaId, b: storage.ReplicaId) {
124124
return a.equals(b);
125125
} else if (a == null && b == null) {
126126
return true;
127-
} else if (a != null || b != null) {
127+
} else if ((b == null && a != null) || (a == null && b != null)) {
128128
return false;
129129
} else {
130130
// There are many possible primitive values, this covers them all
@@ -156,10 +156,9 @@ export function isUUID(value: any): value is bson.UUID {
156156
return uuid._bsontype == 'Binary' && uuid.sub_type == bson.Binary.SUBTYPE_UUID;
157157
}
158158

159-
160159
/**
161160
* Helper function for creating a MongoDB client from consumers of this package
162161
*/
163-
export const createMongoClient =(url: string, options?: mongo.MongoClientOptions) => {
162+
export const createMongoClient = (url: string, options?: mongo.MongoClientOptions) => {
164163
return new mongo.MongoClient(url, options);
165-
}
164+
};

0 commit comments

Comments
 (0)