Skip to content

Refactor tests for startBatch() -> createWriter()#549

Open
rkistner wants to merge 8 commits intomainfrom
startbatch-refactor
Open

Refactor tests for startBatch() -> createWriter()#549
rkistner wants to merge 8 commits intomainfrom
startbatch-refactor

Conversation

@rkistner
Copy link
Contributor

@rkistner rkistner commented Mar 6, 2026

This ports a refactoring from #468:

  1. Replace startBatch() using a callback with createWriter() as an AsyncDisposable.
  2. Pull that refactoring throughout the tests.
  3. In tests, replace a hardcoded TEST_TABLE with await resolveTestTable(writer), which will eventually return a real SourceTable instead of a mocked one.
  4. There are also other minor test changes to align the tests more with [Incremental Reprocessing] [WIP] Proof-of-concept incremental reprocessing for MongoDB #468.

This does not remove the internal usage of startBatch() yet - it mostly focuses on the test refactor. The internal usage of startBatch() can be tackled next.

The main goal is to reduce the diff size and potential for merge conflicts from #468.

@rkistner rkistner requested a review from stevensJourney March 6, 2026 08:11
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 54ceed8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@powersync/service-module-postgres-storage Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-core-tests Patch
@powersync/service-module-mongodb Patch
@powersync/service-core Patch
@powersync/service-schema Patch
@powersync/service-module-mssql Patch
@powersync/service-module-mysql Patch
@powersync/service-module-postgres Patch
@powersync/service-image Patch
@powersync/service-module-core Patch
test-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rkistner rkistner changed the title Test refactor for BucketBatch -> Writer Refactor tests for startBatch() -> createWriter() Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant