Skip to content

Commit 774f5a7

Browse files
committed
merge: catch up with main (raw change streams PR #591)
Merges upstream main which includes PR #591 (raw change streams) and PR #599 (direct BSON Buffer -> JSON conversion). Auth fix conflicts (types.ts, config.test.ts) resolved — both sides had the same fix, upstream also added database name decoding. ChangeStream.ts has 11 unresolved conflicts — PR #591 replaced the MongoDB driver ChangeStream with a custom RawChangeStream using raw aggregate + getMore. Our Cosmos DB changes need to be re-applied to the new code structure. Resolved in the next commit. resolve: ChangeStream.ts merge conflicts for raw change streams Re-applied all Cosmos DB changes to the new raw change stream code structure from PR #591. The raw aggregate approach is better for Cosmos DB: no lazy ChangeStream init, explicit cursor management, $changeStream stage built directly in pipeline. Changes applied to new structure: - detectCosmosDb() calls in getSnapshotLsn, initReplication, streamChangesInternal - getEventTimestamp() adapted to ProjectedChangeStreamDocument type - Sentinel checkpoint with BSON.deserialize for fullDocument (raw Buffer) - Pipeline guards: skip $changeStreamSplitLargeEvent and showExpandedEvents - Cluster-level aggregate (admin db + allChangesForCluster) when isCosmosDb - startAtOperationTime fix (startAfter != null) - Keepalive guard for Cosmos DB resume tokens - .lte() dedup guard skip on Cosmos DB - wallTime tracking for replication lag - Added changeset for @powersync/service-module-mongodb (minor) Verified: 59/59 standard MongoDB tests pass. Cosmos DB cluster is currently down — tests blocked by TLS timeout. Code audit of RawChangeStream.ts found no compatibility issues: cursor ID type auto-fixed by BigInt, postBatchResumeToken needs empirical verification when cluster is back.
2 parents a357055 + e5074f0 commit 774f5a7

File tree

164 files changed

+11427
-2721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+11427
-2721
lines changed

.changeset/bright-clouds-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/service-module-mongodb': minor
3+
---
4+
5+
Add experimental Cosmos DB MongoDB vCore support. Auto-detects Cosmos DB via `hello` command and applies workarounds for missing `clusterTime`, `operationTime`, and unsupported change stream features.

.changeset/calm-doors-shine.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/service-module-mongodb': minor
3+
---
4+
5+
Use custom MongoDB change stream implementation to get better low-level control.

.changeset/fluffy-carpets-repair.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fresh-terms-accept.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/honest-timers-push.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/loud-penguins-march.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/nice-eels-dance.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@powersync/service-module-postgres-storage': patch
3+
'@powersync/service-module-mongodb-storage': patch
4+
'@powersync/service-core-tests': patch
5+
'@powersync/service-module-postgres': patch
6+
'@powersync/service-core': patch
7+
'@powersync/service-sync-rules': patch
8+
'@powersync/lib-service-mongodb': patch
9+
---
10+
11+
Add `config.storage_version` configuration option.

.changeset/stupid-pianos-laugh.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/tame-carrots-sit.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)