Skip to content

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

Merged
rkistner merged 10 commits intomainfrom
startbatch-refactor
Mar 10, 2026
Merged

Refactor tests for startBatch() -> createWriter()#549
rkistner merged 10 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: 23c4238

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
stevensJourney
stevensJourney previously approved these changes Mar 10, 2026
Copy link
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this new addition. Happy with the changes.

@rkistner rkistner merged commit 4c92c24 into main Mar 10, 2026
44 checks passed
@rkistner rkistner deleted the startbatch-refactor branch March 10, 2026 13:47
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.

2 participants