Commit 774f5a7
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.File tree
164 files changed
+11427
-2721
lines changed- .changeset
- .github/workflows
- docs
- libs
- lib-mongodb
- src
- db
- types
- test/src
- lib-postgres
- src/db/connection
- lib-services
- src/logger
- modules
- module-core
- module-mongodb-storage
- src
- storage
- implementation
- common
- v1
- v3
- utils
- test/src
- module-mongodb
- scripts
- src/replication
- test/src
- module-mssql
- ci
- module-mysql
- module-postgres-storage
- src/storage
- module-postgres
- src
- api
- replication
- test/src
- packages
- jpgwire
- rsocket-router
- schema
- service-client
- service-core-tests
- src
- test-utils
- tests
- service-core
- src
- api
- routes/endpoints
- storage
- sync
- test/src/sync
- service-errors
- src
- sync-rules
- src
- test/src
- types
- src
- service
- test-client
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| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
This file was deleted.
This file was deleted.
0 commit comments