Skip to content

Sync streams#86

Merged
simolus3 merged 6 commits intomainfrom
sync-streams
Jan 28, 2026
Merged

Sync streams#86
simolus3 merged 6 commits intomainfrom
sync-streams

Conversation

@simolus3
Copy link
Contributor

@simolus3 simolus3 commented Oct 29, 2025

This adds support for sync streams by porting the API from Kotlin:

  • Calling syncStream() on a PowerSync database instance returns a handle that can be subscribe()d, returning a SyncStreamSubscription.
  • SyncStreamSubscription can be used to wait for that subscription to first sync.
  • All kinds of sync streams, subscribed to or not, can be passed to SyncStatusData.forStream to get the current status for a stream.

All of this is implemented by delegating calls to the Kotlin equivalent. This also means that it's quite light on tests (reliably testing this would require porting the approach of mocking streaming HTTP responses, but the functionality is covered by Kotlin tests.

I've also added sync streams to the demo as an opt-in. Marking them as enabled via secrets would make the demo load list items on-demand as the user navigates to them.

Base automatically changed from pre-update-kotlin to main December 12, 2025 11:00
@simolus3 simolus3 marked this pull request as ready for review January 22, 2026 14:31
stevensJourney
stevensJourney previously approved these changes Jan 27, 2026
Copy link
Contributor

@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'm happy with the changes from my side! Looks great!

Copy link
Contributor

@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.

:shipit:

@simolus3 simolus3 merged commit 000c543 into main Jan 28, 2026
3 checks passed
@simolus3 simolus3 deleted the sync-streams branch January 28, 2026 09:29
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