Skip to content

Commit 3e01540

Browse files
committed
Revert unrelated changes
1 parent 9045f3a commit 3e01540

File tree

7 files changed

+10
-23
lines changed

7 files changed

+10
-23
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const replicationMutex = new utils.Mutex();
4545
export interface MongoBucketBatchOptions {
4646
db: PowerSyncMongo;
4747
syncRules: SqlSyncRules;
48-
syncRulesId: string;
4948
groupId: number;
5049
slotName: string;
5150
lastCheckpointLsn: string | null;
@@ -73,7 +72,6 @@ export class MongoBucketBatch
7372
public readonly db: PowerSyncMongo;
7473
public readonly session: mongo.ClientSession;
7574
private readonly sync_rules: SqlSyncRules;
76-
private readonly syncRulesId: string;
7775

7876
private readonly group_id: number;
7977

@@ -129,7 +127,6 @@ export class MongoBucketBatch
129127
this.session = this.client.startSession();
130128
this.slot_name = options.slotName;
131129
this.sync_rules = options.syncRules;
132-
this.syncRulesId = options.syncRulesId;
133130
this.storeCurrentData = options.storeCurrentData;
134131
this.skipExistingRows = options.skipExistingRows;
135132
this.markRecordUnavailable = options.markRecordUnavailable;
@@ -465,7 +462,7 @@ export class MongoBucketBatch
465462
const { results: evaluated, errors: syncErrors } = this.sync_rules.evaluateRowWithErrors({
466463
record: after,
467464
sourceTable,
468-
bucketIdTransformer: SqlSyncRules.versionedBucketIdTransformer(this.syncRulesId)
465+
bucketIdTransformer: SqlSyncRules.versionedBucketIdTransformer(`${this.group_id}`)
469466
});
470467

471468
for (let error of syncErrors) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ export class MongoSyncBucketStorage
154154
logger: options.logger,
155155
db: this.db,
156156
syncRules: this.sync_rules.parsed(options).sync_rules,
157-
syncRulesId: `${this.sync_rules.id}`,
158157
groupId: this.group_id,
159158
slotName: this.slot_name,
160159
lastCheckpointLsn: checkpoint_lsn,

modules/module-mongodb/src/replication/MongoRelation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { mongo } from '@powersync/lib-service-mongodb';
22
import { storage } from '@powersync/service-core';
3-
import { JsonContainer } from '@powersync/service-jsonbig';
3+
import { JSONBig, JsonContainer } from '@powersync/service-jsonbig';
44
import {
55
CompatibilityContext,
66
CustomArray,
77
CustomObject,
88
CustomSqliteValue,
9+
DatabaseInputValue,
910
SqliteInputRow,
1011
SqliteInputValue,
12+
SqliteRow,
13+
SqliteValue,
1114
DateTimeValue
1215
} from '@powersync/service-sync-rules';
1316

modules/module-mongodb/test/src/mongo_test.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import {
44
CompatibilityContext,
55
CompatibilityEdition,
66
SqliteInputRow,
7-
SqlSyncRules,
8-
TimeValue
7+
SqlSyncRules
98
} from '@powersync/service-sync-rules';
109
import { describe, expect, test } from 'vitest';
1110

@@ -168,7 +167,7 @@ describe('mongo data types', () => {
168167

169168
expect(sqliteValue[2]).toMatchObject({
170169
_id: 3n,
171-
date: new TimeValue('2023-03-06 13:47:00.000Z', '2023-03-06T13:47:00.000Z')
170+
date: '2023-03-06 13:47:00.000Z'
172171
});
173172

174173
expect(sqliteValue[3]).toMatchObject({
@@ -222,7 +221,7 @@ describe('mongo data types', () => {
222221

223222
expect(sqliteValue[2]).toMatchObject({
224223
_id: 3n,
225-
date: ['2023-03-06 13:47:00.000Z']
224+
date: '["2023-03-06 13:47:00.000Z"]'
226225
});
227226

228227
expect(sqliteValue[3]).toMatchObject({

modules/module-postgres-storage/src/storage/PostgresSyncRulesStorage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ export class PostgresSyncRulesStorage
330330
logger: options.logger ?? framework.logger,
331331
db: this.db,
332332
sync_rules: this.sync_rules.parsed(options).sync_rules,
333-
syncRulesId: `${this.sync_rules.id}`,
334333
group_id: this.group_id,
335334
slot_name: this.slot_name,
336335
last_checkpoint_lsn: checkpoint_lsn,

modules/module-postgres-storage/src/storage/batch/PostgresBucketBatch.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export interface PostgresBucketBatchOptions {
2525
logger: Logger;
2626
db: lib_postgres.DatabaseClient;
2727
sync_rules: sync_rules.SqlSyncRules;
28-
syncRulesId: string;
2928
group_id: number;
3029
slot_name: string;
3130
last_checkpoint_lsn: string | null;
@@ -74,7 +73,6 @@ export class PostgresBucketBatch
7473

7574
protected write_checkpoint_batch: storage.CustomWriteCheckpointOptions[];
7675
protected readonly sync_rules: sync_rules.SqlSyncRules;
77-
private readonly syncRulesId: string;
7876
protected batch: OperationBatch | null;
7977
private lastWaitingLogThrottled = 0;
8078
private markRecordUnavailable: BucketStorageMarkRecordUnavailable | undefined;
@@ -90,7 +88,6 @@ export class PostgresBucketBatch
9088
this.resumeFromLsn = options.resumeFromLsn;
9189
this.write_checkpoint_batch = [];
9290
this.sync_rules = options.sync_rules;
93-
this.syncRulesId = options.syncRulesId;
9491
this.markRecordUnavailable = options.markRecordUnavailable;
9592
this.batch = null;
9693
this.persisted_op = null;
@@ -829,7 +826,7 @@ export class PostgresBucketBatch
829826
const { results: evaluated, errors: syncErrors } = this.sync_rules.evaluateRowWithErrors({
830827
record: after,
831828
sourceTable,
832-
bucketIdTransformer: sync_rules.SqlSyncRules.versionedBucketIdTransformer(this.syncRulesId)
829+
bucketIdTransformer: sync_rules.SqlSyncRules.versionedBucketIdTransformer(`${this.group_id}`)
833830
});
834831

835832
for (const error of syncErrors) {

packages/jpgwire/src/pgwire_types.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,7 @@ export class PgType {
182182
const decoded = this.decode(unescaped, elemTypeOid);
183183
stack[0].push(decoded);
184184
}
185-
186-
if (ch == 0x7d /*}*/) {
187-
const entry = stack.shift();
188-
result = entry;
189-
} else {
190-
result = false;
191-
}
192-
185+
result = ch == 0x7d /*}*/ && stack.shift();
193186
elStart = i + 1; // TODO dry
194187
}
195188
}

0 commit comments

Comments
 (0)