Skip to content

Add state tracking to Sync Diagnostics Client#840

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

Add state tracking to Sync Diagnostics Client#840
bean1352 wants to merge 14 commits intomainfrom
feat/refactor-sync-diagnostics-client-cache

Conversation

@bean1352
Copy link
Contributor

@bean1352 bean1352 commented Feb 2, 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.

…r. Added route management with generated route tree and updated components for authentication flow. Removed deprecated login and entry pages.
…te generation and add '@tanstack/router-cli' as a new dev dependency.
…ge. Added query history management in SQL console and local state handling via a separate PowerSync local database .
@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2026

⚠️ No Changeset found

Latest commit: de763e5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…types/react-dom versions for compatibility improvements.
…back for failed actions. Display 'No results' message in SQL console when no data is available.
…ation comments. Removed unnecessary runQueryOnce option and legacy migration code for clarity.
@bean1352 bean1352 force-pushed the feat/refactor-sync-diagnostics-client-cache branch from 2541291 to 71bc993 Compare February 4, 2026 11:38
- Update @types/react and @types/react-dom to 18.3.1
- Remove tsconfig project references causing duplicate type resolution
- Add explicit paths mapping for react types
@bean1352 bean1352 requested a review from Chriztiaan February 4, 2026 12:55
@bean1352 bean1352 marked this pull request as ready for review February 4, 2026 15:34
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