@procedures/store 0.39.0 → 0.41.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @procedures/store
2
2
 
3
+ ## 0.41.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [37deb07]
8
+ - Updated dependencies [fc52431]
9
+ - @procedures/client@0.41.0
10
+ - @procedures/collections@0.41.0
11
+
12
+ ## 0.40.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 877b6aa: `HybridStorage`: the default `isUnavailable` gives true for a `TIMEOUT` (roadmap O68). Before, a `write-through` write that timed out was undone and threw the `TIMEOUT`, though the remote can have applied it. At this time, the write stays in the local copy, goes in the queue, and throws `PendingWriteError`. The drain sends it again. The collection writes set or delete a value by id, so a second send gives the same item. With `versionOf`, the push sends the base version, and an earlier send that reached the remote is not a conflict. The push then sends the same value one more time, with the current version as its precondition. That write changes no value and no version, but a subscriber of the remote can get a second change event for the item.
17
+
18
+ Migration steps:
19
+
20
+ - The site: no step. It does not catch a `TIMEOUT` of a `HybridStorage` write.
21
+ - MiniMongo: no step, unless code catches a `TIMEOUT` of a `write-through` write to show an undo. That code gets `PendingWriteError`, with the `TIMEOUT` as its `cause`.
22
+ - Graph: the own `isUnavailable` that keeps `TIMEOUT` in the queue is not necessary at this time. Remove it, or keep it: the result is the same.
23
+ - jarvis: no step. To keep the old behavior, pass `isUnavailable: (error) => error?.retryable === true || error?.code === undefined`.
24
+
25
+ ### Patch Changes
26
+
27
+ - @procedures/client@0.40.0
28
+ - @procedures/collections@0.40.0
29
+
3
30
  ## 0.39.0
4
31
 
5
32
  ### Patch Changes
package/README.md CHANGED
@@ -181,6 +181,7 @@ await users.setMode("write-through"); // The switch sends the queue, then syncs
181
181
 
182
182
  - In the modes `local-only` and `write-back`, each write goes in the queue.
183
183
  - In the mode `write-through`, a write that the remote cannot take goes in the queue, and the write throws `PendingWriteError`.
184
+ - By default, a write that the remote cannot take is an error with `retryable: true`, an error without a `code`, or a `TIMEOUT`. The option `isUnavailable` changes it.
184
185
  - A full queue refuses the next write with `QueueFullError`. The limit is `maxOfflineOps`, 1000 by default.
185
186
  - A push keeps a write that the remote cannot take at this time (`isUnavailable` gives true). This write and the later writes stay in the queue.
186
187
  - A queued write that the remote refuses leaves the queue, and the push goes on with the next write.