@drakkar.software/starfish-client 3.0.0-alpha.35 → 3.0.0-alpha.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.
package/dist/sync.d.ts CHANGED
@@ -112,10 +112,20 @@ export declare class SyncManager {
112
112
  * action to absorb a background revalidation result (delivered via
113
113
  * {@link StarfishClientOptions.onRevalidated}) into the store.
114
114
  *
115
- * Unlike {@link pull}, `ingest` never does a deep-merge with the previous
116
- * checkpoint the revalidated result is always a full fresh snapshot. It
117
- * sets `lastFromCache = false` (a revalidation is a live response) so the
118
- * binding can clear its `stale` flag.
115
+ * Like {@link pull}, `ingest` conflict-merges the snapshot against the
116
+ * established baseline via `this.onConflict` when a checkpoint exists so a
117
+ * union-merge store does not lose array items when a revalidation result
118
+ * (e.g. a stale cache-fallback on 429/5xx) is a shorter snapshot. The first
119
+ * ingest (no checkpoint yet) takes the snapshot wholesale. Sets
120
+ * `lastFromCache = false` (a revalidation is a live response) so the binding
121
+ * can clear its `stale` flag.
122
+ *
123
+ * **Staleness guard**: if a `push()` advanced `lastCheckpoint` between the
124
+ * time the revalidation request was sent and the time it resolves, the
125
+ * result is from an older document version. Ingesting it would clobber the
126
+ * user's just-saved edit and reset `lastHash` to a stale server hash
127
+ * (causing a spurious 409 on the next push). We silently drop the result in
128
+ * that case — the store's post-push state is already correct.
119
129
  */
120
130
  ingest(result: PullResult): Promise<void>;
121
131
  pull(): Promise<PullResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drakkar.software/starfish-client",
3
- "version": "3.0.0-alpha.35",
3
+ "version": "3.0.0-alpha.37",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Drakkar-Software/starfish.git",
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "description": "TypeScript client SDK for the Starfish sync protocol",
13
13
  "type": "module",
14
+ "sideEffects": false,
14
15
  "main": "./dist/index.js",
15
16
  "types": "./dist/index.d.ts",
16
17
  "exports": {
@@ -41,6 +42,10 @@
41
42
  "./testing": {
42
43
  "types": "./dist/testing.d.ts",
43
44
  "import": "./dist/testing.js"
45
+ },
46
+ "./suspense": {
47
+ "types": "./dist/bindings/suspense.d.ts",
48
+ "import": "./dist/bindings/suspense.js"
44
49
  }
45
50
  },
46
51
  "peerDependencies": {
@@ -64,7 +69,7 @@
64
69
  }
65
70
  },
66
71
  "dependencies": {
67
- "@drakkar.software/starfish-protocol": "3.0.0-alpha.35"
72
+ "@drakkar.software/starfish-protocol": "3.0.0-alpha.37"
68
73
  },
69
74
  "devDependencies": {
70
75
  "@legendapp/state": "^2.0.0",