@procedures/store 0.37.0 → 0.38.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,14 @@
1
1
  # @procedures/store
2
2
 
3
+ ## 0.38.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 3030000: `HybridStorage`: a queued write that the remote refuses no longer blocks the queue (roadmap O67). Before, the push kept a refused write (for example `FORBIDDEN` or `VALIDATION_ERROR`) at the head of the queue and sent it again at each drain. A new write in `write-through` mode then failed too. Now the refused write leaves the queue, the local copy gets the remote values of its ids again, and the push goes on. The new optional option `isRefusal` tells which errors are refusals. Its default codes are `FORBIDDEN`, `VALIDATION_ERROR`, `INVALID_REQUEST`, `NOT_EXPOSED` and `NOT_DECLARED`. The new optional hook `onRefused` gets each refusal. Another error, for example `TIMEOUT` or `UNAUTHORIZED`, keeps the write in the queue, as before.
8
+ - Updated dependencies [c6fba49]
9
+ - @procedures/client@0.38.0
10
+ - @procedures/collections@0.38.0
11
+
3
12
  ## 0.37.0
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -182,6 +182,12 @@ await users.setMode("write-through"); // The switch sends the queue, then syncs
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
184
  - A full queue refuses the next write with `QueueFullError`. The limit is `maxOfflineOps`, 1000 by default.
185
+ - 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
+ - A queued write that the remote refuses leaves the queue, and the push goes on with the next write.
187
+ - A refusal is an error for which `isRefusal` gives true. The default codes are `FORBIDDEN`, `VALIDATION_ERROR`, `INVALID_REQUEST`, `NOT_EXPOSED` and `NOT_DECLARED`.
188
+ - Another error, for example `TIMEOUT` or `UNAUTHORIZED`, keeps the write at the head of the queue. The next push sends it again.
189
+ - After a refusal, the local copy gets the remote values of its ids again. An id that a later queued write changes keeps its local value.
190
+ - The option `onRefused` gets each refusal: the write, its ids, the error, and `restored`. An error of the hook does not stop the push.
185
191
  - The option `queueStore` keeps the queue. The storage writes each change to the store before the write ends.
186
192
  - A new storage with the same store loads the queue, shows its writes, and sends them.
187
193
  - `MemoryQueueStore` is the default. `FileQueueStore` keeps the queue in a JSON Lines file, for Node.