feat: data sync improvements 2026 03 04#262
Merged
williscool merged 5 commits intomasterfrom Mar 6, 2026
Merged
Conversation
Sync button not disabled during async resync operation Medium Severity The isSyncing flag is derived solely from pendingOps > 0, which is updated by a 1-second polling interval. When the user clicks "Full Resync," handleSync runs asynchronously but isSyncing remains false until the next poll detects queued CRUD operations. During that gap (up to ~1 second plus the psResyncTable execution time), the button stays enabled. A second click triggers a concurrent psResyncTable, whose psClearTable can run between the first call's psClearTable and psInsertDbTable, deleting freshly inserted rows and producing an incomplete sync.
Code Coverage Report
|
📊 Code Coverage Summary
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
📊 Code Coverage Summary
|
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.
fixes #260
Note
Medium Risk
Changes the primary sync button to delete all remote
eventsV9rows before re-uploading, which can affect data integrity if the local dataset is incomplete. Adds new progress tracking and polling that could misreport status if counters/queue state get out of sync.Overview
Turns the main Data Sync action into a full resync.
SetupSyncnow calls a newpsResyncTable()helper that clears the remote PowerSync table and then re-inserts all localeventsV9rows, replacing the previous insert-only workflow.Adds a user-facing sync progress/completion indicator. The UI polls
ps_crudviagetPendingCrudCount()and displays live counts of queued ops plus per-op upload counters recorded inConnector.uploadData(), disabling the sync button while syncing and showing a completion timestamp when the queue drains.Adds a new design doc
docs/dev_todo/data_sync_improvements.mddescribing the motivation and phased plan for these changes.Written by Cursor Bugbot for commit 99f4f00. This will update automatically on new commits. Configure here.