@drakkar.software/starfish-client 3.0.0-alpha.35 → 3.0.0-alpha.36
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/bindings/zustand.js +38 -16
- package/dist/bindings/zustand.js.map +2 -2
- package/dist/client.d.ts +6 -0
- package/dist/index.js +38 -16
- package/dist/index.js.map +2 -2
- package/dist/sync.d.ts +14 -4
- package/package.json +2 -2
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
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
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.
|
|
3
|
+
"version": "3.0.0-alpha.36",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/Drakkar-Software/starfish.git",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@drakkar.software/starfish-protocol": "3.0.0-alpha.
|
|
67
|
+
"@drakkar.software/starfish-protocol": "3.0.0-alpha.36"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@legendapp/state": "^2.0.0",
|