Conversation
# Conflicts: # common/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt # common/src/commonMain/kotlin/com/powersync/sync/StreamingSyncClient.kt # common/src/commonMain/kotlin/com/powersync/sync/SyncOptions.kt
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 a possible approach for the backend connector split (https://github.com/orgs/powersync-ja/discussions/787).
API changes
(These should not be considered final)
This splits
PowerSyncBackendConnectorinto two new interfaces:Authenticator(used for downloads), exposing theresolveCredentials()andinvalidateCredentials()methods. The name ofresolveCredentialsreflects that users won't necessarily fetch credentials everytime the method is called. In many cases, users manage the JWT as part of their app state and would simply return that.invalidateCredentials()is a hint from the SDK that the JWT has been rejected by the service.MutationUploader(used for uploads) exposesuploadMutations, called by SDKs to uploadps_crudrecords. This interface can also be implemented as a closure.A new
connect()overload takes independent authenticator and uploader instances, which allows implementing these independently and connecting in download or upload-only mode.The streaming sync implementation skips the download or upload loop if the authenticator or uploader is not set.