Skip to content

feat: data sync improvements 2026 03 04#262

Merged
williscool merged 5 commits intomasterfrom
feat/data_sync_improvements_2026_03_04
Mar 6, 2026
Merged

feat: data sync improvements 2026 03 04#262
williscool merged 5 commits intomasterfrom
feat/data_sync_improvements_2026_03_04

Conversation

@williscool
Copy link
Copy Markdown
Owner

@williscool williscool commented Mar 6, 2026

fixes #260


Note

Medium Risk
Changes the primary sync button to delete all remote eventsV9 rows 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. SetupSync now calls a new psResyncTable() helper that clears the remote PowerSync table and then re-inserts all local eventsV9 rows, replacing the previous insert-only workflow.

Adds a user-facing sync progress/completion indicator. The UI polls ps_crud via getPendingCrudCount() and displays live counts of queued ops plus per-op upload counters recorded in Connector.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.md describing the motivation and phased plan for these changes.

Written by Cursor Bugbot for commit 99f4f00. This will update automatically on new commits. Configure here.

@williscool williscool changed the title feat/data sync improvements 2026 03 04 feat: data sync improvements 2026 03 04 Mar 6, 2026
Comment thread src/lib/features/SetupSync.tsx Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Build artifacts for PR #262 (commit 5dc05cf) are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Code Coverage Report

Overall Project 34.25% 🍏

There is no coverage information present for the Files changed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

📊 Code Coverage Summary

Coverage Type Coverage
Overall 27.19
Changed Files 100

View detailed coverage report

@williscool williscool enabled auto-merge (squash) March 6, 2026 03:47
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/lib/features/SetupSync.tsx
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Build artifacts for PR #262 (commit 99f4f00) are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

📊 Code Coverage Summary

Coverage Type Coverage
Overall 34.25
Changed Files 100

View detailed coverage report

@williscool williscool merged commit 0bccb79 into master Mar 6, 2026
17 checks passed
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.

Feature: Improvements for the data sync feature

1 participant