@syncular/react 0.24.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -66,8 +66,8 @@ availability, refresh }`. `availability` is the typed `ready`, `migrating`, or
66
66
  schema is incompatible or the browser leader is unreachable. `isLoading`
67
67
  is `false`; previously read rows remain available for deliberate read-only
68
68
  UI, and `availability.reason` identifies the boundary;
69
- - `error`: the initial read failed. A later refresh error keeps existing rows
70
- and phase visible through `error`/`isRefreshing`.
69
+ - `error`: the latest read failed. A refresh error keeps the rows and revision
70
+ from the last successful read while setting `isRefreshing` to `false`.
71
71
 
72
72
  ## Provider and async initialization
73
73
 
@@ -279,6 +279,13 @@ mirrored store. The maintained fixture and upgrade guidance live in the
279
279
 
280
280
  ### Privacy-safe support view
281
281
 
282
+ Failed generated and raw live-query reads appear in
283
+ `diagnosticsSnapshot().queryFailures` until that query reads successfully.
284
+ Each entry contains only the stable PHI-free query id, generated table names,
285
+ a stable error code, an optional SQLite result code, and the first failure
286
+ time. It never contains SQL, parameters, rows, or SQLite error prose. Raw SQL
287
+ uses the diagnostic id `raw` unless `useRawSql` receives an explicit `id`.
288
+
282
289
  Use application-owned, stable, PHI-free subscription ids to make missing
283
290
  registration distinguishable from a completed zero-row bootstrap. The hook
284
291
  refreshes after diagnostics events on direct, Worker, Tauri, and React Native
@@ -3,4 +3,4 @@
3
3
  * Vite HMR uses it to replace a worker owner after a Syncular package upgrade
4
4
  * even when the application's generated schema version did not change.
5
5
  */
6
- export declare const SYNCULAR_REACT_RUNTIME_VERSION = "0.24.0";
6
+ export declare const SYNCULAR_REACT_RUNTIME_VERSION = "0.25.1";
@@ -3,4 +3,4 @@
3
3
  * Vite HMR uses it to replace a worker owner after a Syncular package upgrade
4
4
  * even when the application's generated schema version did not change.
5
5
  */
6
- export const SYNCULAR_REACT_RUNTIME_VERSION = '0.24.0';
6
+ export const SYNCULAR_REACT_RUNTIME_VERSION = '0.25.1';
@@ -12,7 +12,11 @@ export interface UseRawSqlOptions<Row = SqlRow> {
12
12
  /** Generated coverage claims its windows by default. */
13
13
  readonly claimCoverage?: boolean;
14
14
  readonly enabled?: boolean;
15
- /** Stable identity override for a raw query cache entry. */
15
+ /**
16
+ * Stable, PHI-free query id. It names the query in
17
+ * `diagnosticsSnapshot().queryFailures`; without it the query reports as
18
+ * `raw`.
19
+ */
16
20
  readonly id?: string;
17
21
  }
18
22
  export interface UseRawSqlResult<Row> {
@@ -35,7 +35,9 @@ export function useRawSql(sql, params, options) {
35
35
  // identity; executable decoders and row keys follow function identity.
36
36
  // oxlint-disable react-hooks/exhaustive-deps -- canonical value identity is the dependency
37
37
  const entry = useMemo(() => store.query({
38
- id: options?.id ?? `raw:${identity}`,
38
+ // The store keys entries by SQL, params, and dependencies as well, so
39
+ // the id only names the query in diagnostics and never carries SQL.
40
+ id: options?.id ?? 'raw',
39
41
  sql,
40
42
  ...(params !== undefined ? { params } : {}),
41
43
  dependencies,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/react",
3
- "version": "0.24.0",
3
+ "version": "0.25.1",
4
4
  "description": "React hooks for Syncular offline-first sync",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -55,15 +55,15 @@
55
55
  "test": "bun test --preload ./test/setup.ts"
56
56
  },
57
57
  "dependencies": {
58
- "@syncular/client": "0.24.0"
58
+ "@syncular/client": "0.25.1"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "react": ">=18.0.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@happy-dom/global-registrator": "^20.0.0",
65
- "@syncular/core": "0.24.0",
66
- "@syncular/server": "0.24.0",
65
+ "@syncular/core": "0.25.1",
66
+ "@syncular/server": "0.25.1",
67
67
  "@testing-library/react": "^16.1.0",
68
68
  "@types/react": "^18.3.0",
69
69
  "@types/react-dom": "^18.3.0",
@@ -3,4 +3,4 @@
3
3
  * Vite HMR uses it to replace a worker owner after a Syncular package upgrade
4
4
  * even when the application's generated schema version did not change.
5
5
  */
6
- export const SYNCULAR_REACT_RUNTIME_VERSION = '0.24.0';
6
+ export const SYNCULAR_REACT_RUNTIME_VERSION = '0.25.1';
@@ -24,7 +24,11 @@ export interface UseRawSqlOptions<Row = SqlRow> {
24
24
  /** Generated coverage claims its windows by default. */
25
25
  readonly claimCoverage?: boolean;
26
26
  readonly enabled?: boolean;
27
- /** Stable identity override for a raw query cache entry. */
27
+ /**
28
+ * Stable, PHI-free query id. It names the query in
29
+ * `diagnosticsSnapshot().queryFailures`; without it the query reports as
30
+ * `raw`.
31
+ */
28
32
  readonly id?: string;
29
33
  }
30
34
 
@@ -81,7 +85,9 @@ export function useRawSql<Row = SqlRow>(
81
85
  const entry = useMemo(
82
86
  () =>
83
87
  store.query<Row>({
84
- id: options?.id ?? `raw:${identity}`,
88
+ // The store keys entries by SQL, params, and dependencies as well, so
89
+ // the id only names the query in diagnostics and never carries SQL.
90
+ id: options?.id ?? 'raw',
85
91
  sql,
86
92
  ...(params !== undefined ? { params } : {}),
87
93
  dependencies,