Skip to content

Tauri: Report priority sync status - #1147

Merged
simolus3 merged 2 commits into
powersync-ja:mainfrom
LashaKamadadze:tauri-priority-status
Oct 14, 2026
Merged

simolus3 merged 2 commits into
powersync-ja:mainfrom
LashaKamadadze:tauri-priority-status

Conversation

@LashaKamadadze

@LashaKamadadze LashaKamadadze commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to powersync-ja/powersync-native#47 and powersync-ja/powersync-native#48. The Rust SDK now exposes per-priority sync status in 0.1.1, and this forwards it to JavaScript.

Until now, the Tauri plugin always reported priority_status: [], so hasSynced, lastSyncedAt and priorityStatusEntries were unavailable and db.waitForFirstSync() never resolved. This was documented as a current limitation in the README.

This PR:

  • Serializes SyncStatusData::priority_status() in SerializableCoreSyncStatus, in the same shape the core extension uses (priority, last_synced_at in microseconds, has_synced), so the existing JS logic in SyncStatusSnapshot works unchanged. PriorityStatus doesn't implement Serialize, so this adds a small SerializablePriorityStatus wrapper like the existing ones.
  • Bumps powersync to 0.1.1.
  • Removes the limitation from the README.
  • Adds a reports priority sync status integration test: it inserts a ps_sync_state row and subscribes to a stream, which makes the SDK reload the offline status. It then checks waitForFirstSync() and lastSyncedAt.
  • Adds a changeset for tauri-plugin-powersync.

Testing: cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass. I also checked the serialized status of an offline database through the plugin's serializer and fed it into SyncStatusSnapshot: hasSynced becomes true and lastSyncedAt matches the stored timestamp. I couldn't run the Tauri integration suite locally (on Linux, the vitest connection to the webview closes before any test runs, also on unmodified main), and the test step is currently disabled in CI, so the new test hasn't run yet. Could you run it locally like for #1143?

Forward the per-priority sync status from the Rust SDK (powersync 0.1.1)
instead of an empty list, so hasSynced, lastSyncedAt,
priorityStatusEntries and waitForFirstSync() work with the Tauri SDK.
@changeset-bot

changeset-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2c69dbd

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

This PR includes changesets to release 1 package
Name Type
tauri-plugin-powersync 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 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the contribution! I'm happy to run the test locally. This looks good to me apart from one minor nit.

Comment thread packages/tauri/src/database.rs Outdated

@simolus3 simolus3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

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