Skip to content

Add state tracking to Sync Diagnostics Client and improve UX#843

Open
bean1352 wants to merge 2 commits intomainfrom
feat/refactor-sync-diagnostics-client-cache-update
Open

Add state tracking to Sync Diagnostics Client and improve UX#843
bean1352 wants to merge 2 commits intomainfrom
feat/refactor-sync-diagnostics-client-cache-update

Conversation

@bean1352
Copy link
Contributor

@bean1352 bean1352 commented Feb 6, 2026

App state (credentials, dynamic schema, client parameters, query history) now lives in a dedicated local PowerSync DB (localStateDb) instead of localStorage. No app state is stored in localStorage.

  • Local DB schema - Three tables: query_history, app_settings (credentials + dynamic_schema), client_parameters.
  • Two PowerSync databases - synced database (db) for backend data and dynamic schema; local-only database (localStateDb) for app state (credentials, schema cache, client params, query history). Default context uses db; components that need local state use a nested PowerSyncContext.Provider value={localStateDb} so useQuery/writes hit the correct database.
  • Credentials - Stored in local DB (app_settings.powersync_credential).
  • Dynamic schema - Persisted in app_settings.dynamic_schema. Debounced (150 ms) during sync; immediate on connect/clear.
  • Sync overview - Added TanStack useQuery for cached stats (conditional queries + invalidation on DB change). PowerSync useQuery kept for simple reactive SQL elsewhere.
  • SQL console - Added query history drop down.
  • Rust client implementation - Removed the option to switch to the JavaScript implementation as the Rust implementation will soon be the default.
  • Client Parameters - These are now automatically saved as you type, I think this is better UX.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

🦋 Changeset detected

Latest commit: 599e587

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

This PR includes changesets to release 1 package
Name Type
@powersync/diagnostics-app Minor

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

@bean1352 bean1352 requested a review from Chriztiaan February 6, 2026 08:43
@bean1352 bean1352 marked this pull request as ready for review February 6, 2026 08:44
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.

1 participant