Skip to content

Commit 8edcee3

Browse files
author
Conrad Hofmeyr
committed
Polish:
- Terminology consistent with docs - Slight tweaks to messaging - README improvements - Center the SQLite File Inspector content on the page - Fix issue with hover color for link in tooltip
1 parent a54b899 commit 8edcee3

6 files changed

Lines changed: 42 additions & 36 deletions

File tree

‎tools/diagnostics-app/README.md‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Sync Diagnostics Client
22

3-
A browser-based tool for inspecting PowerSync databases. Both live (via sync) and offline (via SQLite file upload).
3+
A browser-based tool for inspecting PowerSync sync behavior and databases. Supports both live syncing from a PowerSync instance, and offline inspection of a SQLite database (by uploading a file).
44

5-
The app is available at [https://diagnostics-app.powersync.com/](https://diagnostics-app.powersync.com/)
5+
A hosted version of the Sync Diagnostics Client is available at [https://diagnostics-app.powersync.com/](https://diagnostics-app.powersync.com/). It can also be run as a local standalone web app. It is based on the [PowerSync Web SDK](/packages/web/).
66

7-
It can also be run as a local standalone web app, and is based on the [web SDK](/packages/web/).
8-
9-
## Running the App
7+
## Running the Sync Diagnostics Client
108

119
### Docker
1210

@@ -18,7 +16,7 @@ The app will be available on http://localhost:8082.
1816

1917
### Local Development
2018

21-
In the root of the repository, run:
19+
In the **root of the repository**, run:
2220

2321
```sh
2422
pnpm install
@@ -39,8 +37,8 @@ The landing page offers two paths:
3937

4038
![](public/images/landing-page.png)
4139

42-
- **Connect to PowerSync**: Live sync diagnostics using a JWT token. View real-time sync status, bucket data, and manage client parameters.
43-
- **Inspect SQLite File**: Offline inspection of a local `SQLite` file. No authentication required.
40+
- **Connect to PowerSync**: Live sync diagnostics using a JWT token. View real-time sync status, bucket data, and manage connection/client parameters.
41+
- **Inspect SQLite File**: Offline inspection of a local SQLite database file. No authentication required.
4442

4543
---
4644

@@ -77,10 +75,10 @@ The main dashboard after connecting:
7775

7876
![](public/images/sync-streams.png)
7977

80-
Manage sync stream subscriptions directly from the Sync Overview page:
78+
Manage Sync Stream subscriptions directly from the _Sync Overview_ page:
8179

82-
- View all active stream subscriptions with their parameters, priority, sync time, and eviction time.
83-
- **Add Subscription**: Subscribe to a new stream with optional parameters and priority.
80+
- View all active Sync Stream subscriptions with their parameters, priority, sync time, and eviction time.
81+
- **Add Subscription**: Subscribe to a new Sync Stream with optional subscription parameters and priority.
8482
- **Unsubscribe**: Remove explicit subscriptions (triggers a reconnect to apply the change).
8583

8684
### SQL Console
@@ -99,13 +97,13 @@ Execute read-only SQL queries against the live PowerSync database:
9997

10098
The schema is dynamically inferred from downloaded data and automatically updated as new data arrives. This page displays the current inferred schema for reference.
10199

102-
Note: Tables with 0 synced rows won't appear in the schema. To refresh after sync rule/stream changes, use "Clear & Redownload" on the Sync Overview page.
100+
Note: Tables with 0 synced rows won't appear in the schema. To refresh after Sync Streams / Sync Rules changes, use "Clear & Redownload" on the _Sync Overview_ page.
103101

104-
### Client Parameters
102+
### Connection Parameters / Client Parameters
105103

106104
![](public/images/client-parameters.png)
107105

108-
Manage client parameters that are sent with sync requests:
106+
Manage [Connection Parameters](https://docs.powersync.com/sync/streams/parameters#connection-parameters) (Sync Streams) / [Client Parameters](https://docs.powersync.com/sync/rules/client-parameters) (Sync Rules) that are sent with sync requests:
109107

110108
- Add, edit, and delete key-value parameters.
111109
- Supports string, number, boolean, array, and object types.
@@ -115,13 +113,13 @@ Manage client parameters that are sent with sync requests:
115113

116114
## SQLite File Inspector
117115

118-
The File Inspector allows offline inspection of SQLite database files. It is useful for post-mortem analysis of database files extracted from devices. No authentication is required.
116+
The File Inspector allows offline inspection of SQLite database files. It is useful for analysis of database files extracted from devices. No authentication is required.
119117

120118
### Opening a File
121119

122120
![](public/images/inspector-drop-zone.png)
123121

124-
Drag and drop a `SQLite` file, or click to browse. The file is opened in-browser using wa-sqlite - nothing is uploaded to a server.
122+
Drag and drop a SQLite database file, or click to browse. The file is opened in-browser using `wa-sqlite` - nothing is uploaded to a server.
125123

126124
### Database Overview
127125

@@ -135,7 +133,7 @@ Drag and drop a `SQLite` file, or click to browse. The file is opened in-browser
135133

136134
![](public/images/inspector-sql-console.png)
137135

138-
Execute read-only SQL queries against the uploaded file. Works the same as the sync SQL console, with separate query history.
136+
Execute read-only SQL queries against the uploaded file. Works the same as the _SQL Console_ for live synced databases, with separate query history.
139137

140138
---
141139

‎tools/diagnostics-app/src/app/views/client-params.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ function ClientParamsContent() {
150150
};
151151

152152
return (
153-
<NavigationPage title="Client Parameters">
153+
<NavigationPage title="Connection/Client Parameters">
154154
<div className="min-w-0 max-w-full overflow-x-hidden p-6">
155155
<Card>
156156
<CardHeader>
157-
<CardTitle className="text-xl">Parameters</CardTitle>
158-
<CardDescription>Configure key-value parameters that will be sent with sync requests.</CardDescription>
157+
<CardTitle className="text-xl">Connection Parameters / Client Parameters</CardTitle>
158+
<CardDescription>Configure key-value Connection Parameters (Sync Streams) / Client Parameters (Sync Rules) that will be sent with sync requests.</CardDescription>
159159
</CardHeader>
160160
<CardContent className="space-y-4">
161161
{(storedParams ?? []).length === 0 ? (

‎tools/diagnostics-app/src/app/views/sync-diagnostics.tsx‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,23 @@ export default function SyncDiagnosticsPage() {
295295
</span>
296296
</TooltipTrigger>
297297
<TooltipContent className="max-w-92">
298-
Two separate limits apply (both PSYNC_S2305, default {DEFAULT_SYNC_LIMIT.toLocaleString()}{' '}
299-
each): <strong>bucket count</strong> and <strong>parameter query results</strong>.
298+
Two separate limits apply: <strong>bucket count</strong> and <strong>parameter query results</strong>.
299+
Both yield a PSYNC_S2305 error when exceeded. Both <a
300+
href="https://docs.powersync.com/debugging/troubleshooting#too-many-buckets-psync_s2305"
301+
target="_blank"
302+
rel="noopener noreferrer"
303+
className="underline hover:text-primary-foreground/80"
304+
>
305+
default
306+
</a>{' '}
307+
to a limit of {DEFAULT_SYNC_LIMIT.toLocaleString()}.
300308
<div className="mt-2">
301309
Global buckets count only toward bucket count. Parameter query buckets (in either{' '}
302310
<a
303311
href="https://docs.powersync.com/sync/rules/parameter-queries"
304312
target="_blank"
305313
rel="noopener noreferrer"
306-
className="underline hover:text-foreground"
314+
className="underline hover:text-primary-foreground/80"
307315
>
308316
Sync Rules
309317
</a>{' '}
@@ -312,12 +320,12 @@ export default function SyncDiagnosticsPage() {
312320
href="https://docs.powersync.com/sync/streams/parameters"
313321
target="_blank"
314322
rel="noopener noreferrer"
315-
className="underline hover:text-foreground"
323+
className="underline hover:text-primary-foreground/80"
316324
>
317325
Sync Streams
318326
</a>
319-
) count toward both, but are de-duplicated client-side, so the server's parameter result count
320-
may be higher.
327+
) count toward both, but are de-duplicated client-side, so the parameter result count
328+
on the PowerSync Service side may be higher.
321329
</div>
322330
</TooltipContent>
323331
</Tooltip>
@@ -516,10 +524,10 @@ export default function SyncDiagnosticsPage() {
516524
<span className={cn('font-medium', totals.buckets >= 900 ? 'text-destructive' : 'text-amber-600')}>
517525
{totals.buckets >= 900 ? 'Critical: ' : 'Warning: '}
518526
</span>
519-
{totals.buckets.toLocaleString()} of {DEFAULT_SYNC_LIMIT.toLocaleString()} buckets used (PSYNC_S2305,
520-
default limit). {totals.parameterized_buckets.toLocaleString()} are parameterized - at least that many
521-
parameter query results on the server. Review your Sync Config to reduce buckets and parameter query
522-
results for this user.{' '}
527+
{totals.buckets.toLocaleString()} buckets used (PSYNC_S2305, default limit of {DEFAULT_SYNC_LIMIT.toLocaleString()} unless specifically
528+
configured higher for your instance). {totals.parameterized_buckets.toLocaleString()} are parameterized - at least that many
529+
parameter query results on the server. Depending on your configuration ({DEFAULT_SYNC_LIMIT.toLocaleString()} is the default limit), you may
530+
need to adjust your Sync Config to reduce the numbe rof buckets and parameter query results for this user.{' '}
523531
<a
524532
href="https://docs.powersync.com/debugging/troubleshooting#too-many-buckets-psync_s2305"
525533
target="_blank"

‎tools/diagnostics-app/src/components/widgets/FileDropZone.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function FileDropZone({ onFileSelected, isLoading, error }: FileDropZoneP
8484
const displayError = validationError || error;
8585

8686
return (
87-
<div className="fixed inset-0 flex flex-col items-center justify-center p-6 overflow-hidden">
87+
<div className="flex min-h-full flex-col items-center justify-center p-6">
8888
<div className="w-full max-w-2xl space-y-5">
8989
{/* Logo & title */}
9090
<div className="flex flex-col items-center gap-2">

‎tools/diagnostics-app/src/components/widgets/NewStreamSubscription.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ export function NewStreamSubscription(props: { open: boolean; close: () => void
7777
{({ values, errors, handleChange, handleBlur, isSubmitting, handleSubmit, setFieldValue }) => (
7878
<form onSubmit={handleSubmit}>
7979
<DialogHeader>
80-
<DialogTitle>Subscribe to sync stream</DialogTitle>
80+
<DialogTitle>Subscribe to Sync Stream</DialogTitle>
8181
<DialogDescription>
82-
Add a stream subscription with optional parameters and priority override.
82+
Add a Sync Stream subscription with optional subscription parameters and priority override.
8383
</DialogDescription>
8484
</DialogHeader>
8585
<div className="grid gap-4 py-4">
8686
<div className="grid grid-cols-3 gap-3">
8787
<div className="col-span-2">
88-
<Label htmlFor="stream-name">Stream name</Label>
88+
<Label htmlFor="stream-name">Sync Stream name</Label>
8989
<Input
9090
id="stream-name"
9191
autoFocus
@@ -119,7 +119,7 @@ export function NewStreamSubscription(props: { open: boolean; close: () => void
119119
</div>
120120
</div>
121121
<div>
122-
<Label>Parameters (JSON)</Label>
122+
<Label>Subscription Parameters (JSON)</Label>
123123
<div
124124
className={cn(
125125
'mt-1.5 rounded-md border overflow-hidden relative',

‎tools/diagnostics-app/src/routes/_authenticated.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const NAVIGATION_ITEMS = [
5757
{ path: '/sync-diagnostics', title: 'Sync Overview', icon: Table2 },
5858
{ path: '/schema', title: 'Dynamic Schema', icon: Database },
5959
{ path: '/sql-console', title: 'SQL Console', icon: Terminal },
60-
{ path: '/client-parameters', title: 'Client Parameters', icon: SlidersHorizontal },
60+
{ path: '/client-parameters', title: 'Connection Parameters', icon: SlidersHorizontal },
6161
{ path: '/file-inspector', title: 'File Inspector', icon: FileSearch }
6262
];
6363

0 commit comments

Comments
 (0)