Repository navigation
Conversation
This branch has not been deployed
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 proposal from https://github.com/orgs/powersync-ja/discussions/787 and allows splitting
PowerSyncBackendConnectorProtocolinto its individual parts: AnAuthenticatorresponsible for returning a JWT used when connecting to the PowerSync service, and aMutationUploadercallback uploading local mutations.Additionally, this adds
connect()overloads that only take an authenticator (for download-only mode) or uploader (for upload-only mode sync). The key differences are:PowerSyncBackendConnectorProtocol,fetchCredentialsis supposed to return a new token each time (the SDK caches it). Tokens from anAuthenticator, aren't cached, giving users more control over them (closes Cached credentials are reused after they expire while the app is suspended, costing a 401 and a full retry delay on resume #193!).PowerSyncCredentials, authenticators just return the JWT directly. The endpoint to connect to is a parameter onconnect().This is a breaking for users implementing
CustomCheckpointRequestConnector, they now need to implementPowerSyncBackendConnectorProtocolas well. Fine as that is an alpha interface.Another known problem is that checkpoints can't be applied when there's local data, so a download-only mode might make the sync client stuck. We'll expose this from the core extension to handle this as an error in powersync-ja/powersync-sqlite-core#227.
AI use: Reviewed with Claude Code.