Repository navigation
Split backend connector interface - #484
Merged
Merged
Conversation
simolus3
force-pushed
the
connector-split
branch
from
October 14, 2026 07:14
e2b6a05 to
8944449
Compare
simolus3
force-pushed
the
connector-split
branch
from
October 22, 2026 10:01
8944449 to
2d34daf
Compare
simolus3
commented
Oct 22, 2026
simolus3
marked this pull request as ready for review
October 22, 2026 11:05
simolus3
force-pushed
the
connector-split
branch
from
October 27, 2026 09:52
2d34daf to
ac09f32
Compare
simolus3
force-pushed
the
connector-split
branch
from
October 27, 2026 13:02
ac09f32 to
061d891
Compare
Chriztiaan
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements the suggested API simplification discussed here for Dart. Instead of passing a
PowerSyncBackendConnector, users can implementAuthenticatorandMutationUploaderinterfaces separately. ForMutationUploader, a default constructor can also wrap simple callbacks.Implementing this without breaking existing users requires a bit of creative API design: Dart doesn't have method overloading, so we can't simply add another
connect()method taking authenticators and uploaders separately. Instead, this replaces thePowerSyncBackendConnectorparameter withConnectRequest, a new supertype. With dot shorthands, I think this looks okay:Splitting the interface makes it easier to get started with PowerSync (one can start with a download-only use case and worry about uploads later), and allows more flexible compositions (e.g. with a default write API uploader and a custom authenticator).
The changes to the streaming sync client are comparable to our other SDKs. Most of this PR deals with the annoying problem that connector methods are also invoked over RPC channels for isolates and web workers. This refactors the
InternalConnectorinterface to split the authenticator / uploader parts as well. In a connect method, we then use two booleans to indicate whether each half is present.TODOs: A follow-up item is that the new interfaces should also receive abort signals.
AI use: Reviewed with Claude Code.