Skip to content

Sync progress #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 2, 2025
Merged

Sync progress #555

merged 20 commits into from
May 2, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Apr 2, 2025

This implements the sync progress API for the JavaScript SDKs.

The overall API is very similar to the one exposed by the other SDKs:

  1. SyncDataFlowStatus, which needs to be transferrable from workers, adds a new InternalProgressInformation field tracking progress across different buckets. Users are encouraged not to use that directly though.
  2. Instead, a new downloadProgress getter is added to SyncStatus with the same interface we expose for Dart and Kotlin: An untilCompletion getter and a untilPriority(priority) method. They both return a structure making the total and downloaded operations available (as well as a relative progress indicator).

I've added unit tests for this through the Node SDK, because that's easier to test with a local core extension build than the Web / RN SDKs that need subsequent builds. I think we should eventually share tests between the SDKs to be sure we're not missing anything, but I think this already points towards the implementation working :)

Copy link

changeset-bot bot commented Apr 2, 2025

🦋 Changeset detected

Latest commit: 1de9e65

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@powersync/common Minor
@powersync/web Minor
@powersync/node Minor
@powersync/react-native Minor
@powersync/op-sqlite Patch
@powersync/tanstack-react-query Patch
@powersync/diagnostics-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@simolus3 simolus3 marked this pull request as ready for review May 2, 2025 10:29
stevensJourney
stevensJourney previously approved these changes May 2, 2025
Copy link
Collaborator

@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 quite happy with the changes here.

@simolus3 simolus3 merged commit 2d22a29 into main May 2, 2025
6 checks passed
@simolus3 simolus3 deleted the sync-progress branch May 2, 2025 17:45
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