Commit 51df2ef
committed
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.1 parent 202c602 commit 51df2ef
File tree
2,783 files changed
+201
-309384
lines changed- .changeset
- .github
- actions
- setup-node-build
- start-mongodb
- start-postgres-storage
- workflows
- .husky
- .jjconflict-base-0/modules/module-mongodb/src/replication
- .jjconflict-side-0
- .changeset
- .github
- actions
- setup-node-build
- start-mongodb
- start-postgres-storage
- workflows
- .husky
- docs
- libs
- lib-mongodb
- src
- db
- locks
- types
- test
- src
- lib-postgres
- src
- db
- connection
- locks
- types
- utils
- test
- src
- lib-services
- src
- alerts
- codec
- errors
- ip
- locks
- logger
- migrations
- router
- schema
- json-schema
- validators
- signals
- probes
- system
- utils
- test
- __snapshots__
- src
- __mocks__
- __snapshots__
- fixtures
- schema
- __snapshots__
- modules
- module-core
- src
- types
- test
- src
- module-mongodb-storage
- src
- migrations
- db/migrations
- module
- storage
- implementation
- common
- v1
- v3
- types
- utils
- test
- src
- __snapshots__
- module-mongodb
- scripts
- src
- api
- common
- module
- replication
- types
- test
- src
- module-mssql
- ci
- dev
- src
- api
- common
- module
- replication
- types
- utils
- test
- src
- module-mysql
- dev
- config
- docker/mysql
- init-scripts
- src
- api
- common
- module
- replication
- zongji
- types
- utils
- test
- src
- module-postgres-storage
- src
- migrations
- scripts
- module
- storage
- batch
- checkpoints
- sync-rules
- types
- models
- utils
- test
- src
- __snapshots__
- module-postgres
- sql
- src
- api
- module
- replication
- types
- utils
- test
- src
- types
- packages
- jpgwire
- ca
- src
- test
- jsonbig
- src
- rsocket-router
- src
- router
- transport
- utils
- test
- src
- utils
- schema
- src
- scripts
- service-client
- src
- service-core-tests
- src
- test-utils
- tests
- service-core
- .probes
- src
- api
- auth
- entry
- commands
- events
- metrics
- open-telemetry
- migrations
- modules
- replication
- routes
- endpoints
- runner
- storage
- streams
- sync
- system
- util
- config
- collectors
- impl
- sync-rules
- impl
- test
- src
- routes
- sync
- util
- service-errors
- src
- test
- src
- sync-rules
- grammar
- docs
- scripts
- src
- compiler
- events
- schema-generators
- streams
- sync_plan
- engine
- evaluator
- types
- test
- src
- compiler
- __snapshots__
- grammar_parity
- fixtures
- sync_plan
- engine
- evaluator
- types
- types
- src
- config
- scripts
- service
- .probes
- local-dev
- src
- runners
- util
- test-client
- src
- load-testing
- .jjconflict-side-1
- .changeset
- .github
- actions
- setup-node-build
- start-mongodb
- start-postgres-storage
- workflows
- .husky
- docs
- libs
- lib-mongodb
- src
- db
- locks
- types
- test
- src
- lib-postgres
- src
- db
- connection
- locks
- types
- utils
- test
- src
- lib-services
- src
- alerts
- codec
- errors
- ip
- locks
- logger
- migrations
- router
- schema
- json-schema
- validators
- signals
- probes
- system
- utils
- test
- __snapshots__
- src
- __mocks__
- __snapshots__
- fixtures
- schema
- __snapshots__
- modules
- module-core
- src
- types
- test
- src
- module-mongodb-storage
- src
- migrations
- db/migrations
- module
- storage
- implementation
- common
- v1
- v3
- types
- utils
- test
- src
- __snapshots__
- module-mongodb
- scripts
- src
- api
- common
- module
- replication
- types
- test
- src
- module-mssql
- ci
- dev
- src
- api
- common
- module
- replication
- types
- utils
- test
- src
- module-mysql
- dev
- config
- docker/mysql
- init-scripts
- src
- api
- common
- module
- replication
- zongji
- types
- utils
- test
- src
- module-postgres-storage
- src
- migrations
- scripts
- module
- storage
- batch
- checkpoints
- sync-rules
- types
- models
- utils
- test
- src
- __snapshots__
- module-postgres
- sql
- src
- api
- module
- replication
- types
- utils
- test
- src
- types
- packages
- jpgwire
- ca
- src
- test
- jsonbig
- src
- rsocket-router
- src
- router
- transport
- utils
- test
- src
- utils
- schema
- src
- scripts
- service-client
- src
- service-core-tests
- src
- test-utils
- tests
- service-core
- .probes
- src
- api
- auth
- entry
- commands
- events
- metrics
- open-telemetry
- migrations
- modules
- replication
- routes
- endpoints
- runner
- storage
- streams
- sync
- system
- util
- config
- collectors
- impl
- sync-rules
- impl
- test
- src
- routes
- sync
- util
- service-errors
- src
- test
- src
- sync-rules
- grammar
- docs
- scripts
- src
- compiler
- events
- schema-generators
- streams
- sync_plan
- engine
- evaluator
- types
- test
- src
- compiler
- __snapshots__
- grammar_parity
- fixtures
- sync_plan
- engine
- evaluator
- types
- types
- src
- config
- scripts
- service
- .probes
- local-dev
- src
- runners
- util
- test-client
- src
- load-testing
- docs
- libs
- lib-mongodb
- src
- db
- locks
- types
- test
- src
- lib-postgres
- src
- db
- connection
- locks
- types
- utils
- test
- src
- lib-services
- src
- alerts
- codec
- errors
- ip
- locks
- logger
- migrations
- router
- schema
- json-schema
- validators
- signals
- probes
- system
- utils
- test
- __snapshots__
- src
- __mocks__
- __snapshots__
- fixtures
- schema
- __snapshots__
- modules
- module-core
- src
- types
- test
- src
- module-mongodb-storage
- src
- migrations
- db/migrations
- module
- storage
- implementation
- common
- v1
- v3
- types
- utils
- test
- src
- __snapshots__
- module-mongodb
- scripts
- src
- api
- common
- module
- replication
- types
- test
- src
- module-mssql
- ci
- dev
- src
- api
- common
- module
- replication
- types
- utils
- test
- src
- module-mysql
- dev
- config
- docker/mysql
- init-scripts
- src
- api
- common
- module
- replication
- zongji
- types
- utils
- test
- src
- module-postgres-storage
- src
- migrations
- scripts
- module
- storage
- batch
- checkpoints
- sync-rules
- types
- models
- utils
- test
- src
- __snapshots__
- module-postgres
- sql
- src
- api
- module
- replication
- types
- utils
- test
- src
- types
- packages
- jpgwire
- ca
- src
- test
- jsonbig
- src
- rsocket-router
- src
- router
- transport
- utils
- test
- src
- utils
- schema
- src
- scripts
- service-client
- src
- service-core-tests
- src
- test-utils
- tests
- service-core
- .probes
- src
- api
- auth
- entry
- commands
- events
- metrics
- open-telemetry
- migrations
- modules
- replication
- routes
- endpoints
- runner
- storage
- streams
- sync
- system
- util
- config
- collectors
- impl
- sync-rules
- impl
- test
- src
- routes
- sync
- util
- service-errors
- src
- test
- src
- sync-rules
- grammar
- docs
- scripts
- src
- compiler
- events
- schema-generators
- streams
- sync_plan
- engine
- evaluator
- types
- test
- src
- compiler
- __snapshots__
- grammar_parity
- fixtures
- sync_plan
- engine
- evaluator
- types
- types
- src
- config
- scripts
- service
- .probes
- local-dev
- src
- runners
- util
- test-client
- src
- load-testing
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
2,783 files changed
+201
-309384
lines changedFile renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0 commit comments