-
Notifications
You must be signed in to change notification settings - Fork 28
Sync progress status #260
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
base: main
Are you sure you want to change the base?
Sync progress status #260
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the overall structure & apis - just added some implementation comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't check the details of the sync status refactoring, but I'm happy with the overall approach.
This extends
SyncStatus
to report download progress as it happens. Progress is reported as a(completed, total, fraction)
triple (wherefraction = completed / total
) and available:db.currentStatus.downloadProgress.untilCompletion
.db.currentStatus.downloadProgress.untilPriority(myPrio)
.The best way to get a look and feel for the API may be to look at this example usage:
powersync.dart/demos/supabase-todolist/lib/widgets/guard_by_sync.dart
Lines 26 to 53 in 9d45ba3
In an actual app, it looks like this:
Bildschirmaufnahme.2025-03-31.um.13.27.20.mov
There is some delay in the
sync_local
commit not included in the progress bar now, but the amount of operations is updated as it should be.