Skip to content

Improve upload data behavior details + cross-reference sdk pages#390

Open
joshuabrink wants to merge 2 commits intomainfrom
upload-data
Open

Improve upload data behavior details + cross-reference sdk pages#390
joshuabrink wants to merge 2 commits intomainfrom
upload-data

Conversation

@joshuabrink
Copy link
Copy Markdown
Contributor

@joshuabrink joshuabrink commented Apr 8, 2026

Updates the documentation for all PowerSync client SDKs to provide clearer and more detailed guidance on how and when the uploadData() method is called. It introduces links to a new or updated section explaining the triggers, throttling, retry behavior, and error handling associated with uploadData().

@joshuabrink joshuabrink marked this pull request as ready for review April 8, 2026 11:02
@joshuabrink joshuabrink requested a review from benitav April 8, 2026 13:35
1. [PowerSyncBackendConnector.fetchCredentials](https://github.com/powersync-ja/powersync-js/blob/ed5bb49b5a1dc579050304fab847feb8d09b45c7/packages/common/src/client/connection/PowerSyncBackendConnector.ts#L16) \- This method is automatically invoked by the PowerSync Client SDK to obtain authentication credentials. The SDK caches credentials internally and only calls this method when needed (e.g. on initial connection or when the token is near expiry). See [When `fetchCredentials()` is Called](/configuration/app-backend/client-side-integration#when-fetchcredentials-is-called) for details, and [Authentication Setup](/configuration/auth/overview) for instructions on how the credentials should be generated.
2. [PowerSyncBackendConnector.uploadData](https://github.com/powersync-ja/powersync-js/blob/ed5bb49b5a1dc579050304fab847feb8d09b45c7/packages/common/src/client/connection/PowerSyncBackendConnector.ts#L24) \- Use this to upload client-side changes to your app backend.
\-> See [Writing Client Changes](/handling-writes/writing-client-changes) for considerations on the app backend implementation.
2. [PowerSyncBackendConnector.uploadData](https://github.com/powersync-ja/powersync-js/blob/ed5bb49b5a1dc579050304fab847feb8d09b45c7/packages/common/src/client/connection/PowerSyncBackendConnector.ts#L24) \- This method will be automatically invoked by the PowerSync Client SDK whenever it needs to upload client-side writes to your app backend via your backend API. Therefore, in your implementation, you need to define how your backend API is called. See [When `uploadData()` is Called](/configuration/app-backend/client-side-integration#when-uploaddata-is-called) for details on triggers, throttling, and retry behavior, and [Writing Client Changes](/handling-writes/writing-client-changes) for considerations on the app backend implementation.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This reads a bit difficult: the second sentence doesn't quite follow from the first, I think what bothers me most is "in your implementation" - I think the link to uploadData is missing here.

This method will be automatically invoked by the PowerSync Client SDK whenever it needs to upload client-side writes to your app backend via your backend API. Therefore, in your implementation, you need to define how your backend API is called.

Do we overall just want to say that uploadData gets called automatically, and users must define the upload logic in it? Then something like this would flow better IMO (needs polished wording)

This method will be automatically invoked by the PowerSync Client SDK whenever it needs to upload client-side writes to your app backend (via your backend API). You need to define how writes are processed in this method.


## Writing Data (via SQLite Database and Upload Queue)

Any mutations on the SQLite database, namely updates, deletes and inserts, are immediately reflected in the SQLite database, and also also automatically placed into an **upload queue** by the Client SDK.
Copy link
Copy Markdown
Contributor

@michaelbarnes michaelbarnes Apr 8, 2026

Choose a reason for hiding this comment

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

There's a typo caught by the mintlify job

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.

3 participants