@syncular/tauri 0.15.35 → 0.15.37

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.
Files changed (2) hide show
  1. package/README.md +33 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -13,6 +13,33 @@ local Tauri views remain responsive while the native client is syncing over
13
13
  HTTP/WebSocket. Mutations, sync, and all durable writes remain serialized on
14
14
  the single mutable core owner.
15
15
 
16
+ ## Realtime lifecycle
17
+
18
+ Use the supervisor exported by `@syncular/client` for the WebView host policy:
19
+
20
+ ```ts
21
+ import {
22
+ browserConnectivitySignal,
23
+ documentLifecycleSignal,
24
+ installRealtimeSupervisor,
25
+ } from '@syncular/client';
26
+ import { createTauriSyncClient } from '@syncular/tauri';
27
+
28
+ const client = await createTauriSyncClient({ schema });
29
+ installRealtimeSupervisor(client, {
30
+ connectivity: browserConnectivitySignal(),
31
+ lifecycle: documentLifecycleSignal(),
32
+ protection,
33
+ });
34
+ ```
35
+
36
+ The supervisor performs reconnect, bounded retry, resume catch-up, diagnostics,
37
+ and close cancellation without opening duplicate native sockets. The document
38
+ signal is the portable WebView baseline. Apps that observe native sleep/wake or
39
+ window lifecycle should pass that evidence through the same structural
40
+ `RealtimeSupervisorSignal`; protected apps publish `preflight` before releasing
41
+ keys and `active` only after reactivation. Render local SQLite immediately.
42
+
16
43
  The bridge includes the native core's durable commit-outcome journal:
17
44
  `commitOutcome`, `commitOutcomes`, and `resolveCommitOutcome`. Final results
18
45
  and explicit conflict resolutions survive process restarts; active failures
@@ -35,7 +62,12 @@ outbox, and requests a fresh bootstrap while preserving device identity,
35
62
  lease state, outcomes, and protected bookkeeping. The result contains only
36
63
  `alreadyApplied`, `retainedCommits`, and `resetSubscriptions`. It is blocked
37
64
  during security preflight and an active schema-floor stop; it is not a sign-out
38
- or secure-erasure API. The JavaScript bridge strictly validates the exact
65
+ or secure-erasure API. The native SQLite marker atomically retains the original
66
+ counts, so a retry after process restart returns `alreadyApplied: true` with the
67
+ same receipt rather than zero counts. Malformed or unreadable receipt storage
68
+ fails closed as sanitized `sync.local_corrupt` without repeating the reset;
69
+ pre-0.15.36 legacy markers retain their former zero-count compatibility. The
70
+ JavaScript bridge strictly validates the exact
39
71
  acknowledgement shape and non-negative safe-integer counts; version drift or a
40
72
  malformed native response fails with the sanitized, stable
41
73
  `client.invalid_host_response` code before application recovery state can
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncular/tauri",
3
- "version": "0.15.35",
3
+ "version": "0.15.37",
4
4
  "description": "Tauri integration for the Syncular client",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Benjamin Kniffler",
@@ -48,12 +48,12 @@
48
48
  "test": "bun test"
49
49
  },
50
50
  "dependencies": {
51
- "@syncular/client": "0.15.35"
51
+ "@syncular/client": "0.15.37"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@tauri-apps/api": ">=2.0.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@syncular/react": "0.15.35"
57
+ "@syncular/react": "0.15.37"
58
58
  }
59
59
  }