@procedures/mongo 0.52.3 → 0.53.1
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 +53 -0
- package/README.md +1 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/storage/database-changes.d.ts +6 -1
- package/dist/storage/database-changes.d.ts.map +1 -1
- package/dist/storage/database-changes.js +15 -3
- package/dist/storage/database-changes.js.map +1 -1
- package/dist/storage/document-storage.d.ts.map +1 -1
- package/dist/storage/document-storage.js +5 -6
- package/dist/storage/document-storage.js.map +1 -1
- package/dist/storage/materializer.d.ts +6 -0
- package/dist/storage/materializer.d.ts.map +1 -1
- package/dist/storage/materializer.js +12 -5
- package/dist/storage/materializer.js.map +1 -1
- package/dist/storage/storage-hints.d.ts +9 -71
- package/dist/storage/storage-hints.d.ts.map +1 -1
- package/dist/storage/storage-hints.js +22 -9
- package/dist/storage/storage-hints.js.map +1 -1
- package/dist/storage/token-age.d.ts +30 -0
- package/dist/storage/token-age.d.ts.map +1 -0
- package/dist/storage/token-age.js +55 -0
- package/dist/storage/token-age.js.map +1 -0
- package/package.json +10 -8
- package/src/storage/database-changes.ts +22 -3
- package/src/storage/document-storage.ts +5 -7
- package/src/storage/materializer.ts +13 -5
- package/src/storage/storage-hints.ts +27 -9
- package/src/storage/token-age.ts +63 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# @procedures/mongo
|
|
2
2
|
|
|
3
|
+
## 0.53.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 84f0c78: The mongo store limits its change reads and its passes of the views with `semaphore()` of `@mark1russell7/collections`, the home of the semaphore. The behavior does not change: the permits go to the callers in FIFO order.
|
|
8
|
+
|
|
9
|
+
The class `Semaphore` of `@procedures/client` is deprecated. Use `semaphore(permits)` of `@mark1russell7/collections` in its place. Its `run(task)` replaces `withPermit(fn)`, and its `acquire()` gives the release function. The next MINOR break of `@procedures/client` removes the class.
|
|
10
|
+
- Updated dependencies [84f0c78]
|
|
11
|
+
- Updated dependencies [abf290c]
|
|
12
|
+
- @procedures/client@0.53.1
|
|
13
|
+
- @procedures/collections@0.53.1
|
|
14
|
+
|
|
15
|
+
## 0.53.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 831ab0f: Breaking change (roadmap CLI-110): the types `DatabaseChangesWatch` and `StorageChangesWatch` have the new getter `tokenAgeMs`, and it is not optional. The handles of `watchDatabaseChanges()` and `watchStorageChanges()` give it. It gives the milliseconds of the clock of the watcher since the resume token last moved to a later cluster time. Before the first move, it counts from the start of the watcher. A new token at the same cluster time does not move it. An app reads a stalled feed from it, without a sampler of its own.
|
|
20
|
+
|
|
21
|
+
Some apps make their own objects of the type `DatabaseChangesWatch` or `StorageChangesWatch`, for example a fake of a test. To migrate, add the getter `tokenAgeMs` to each of these objects. Code that only reads a handle needs no change.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- The packages use the new versions of their dependencies of the owner: `@mark1russell7/service` `^0.8.3`, `@mark1russell7/coeval` `^0.26.1` and `@mark1russell7/docker-sqlite` `^0.3.0`. The range of `@mark1russell7/collections` stays `^0.5.0`: its version 0.7.0 and later remove names that `@procedures/collections` exports.
|
|
26
|
+
- 556d0a8: The packages use `@mark1russell7/service` `^0.8.2` in place of `^0.6.0`. Version 0.7.0 adds the refusal cause `capacity`, and version 0.8.0 refuses a listen backlog of 0. Version 0.8.2 adds the call context of OpenTelemetry. The types `Clock` and `Cancel` of `@mark1russell7/service/clock` do not change: their home is `@mark1russell7/algebra/clock`, and the entry gives them again.
|
|
27
|
+
|
|
28
|
+
A refusal of a call limit with the cause `capacity` gives `RATE_LIMITED` that is not retryable and has no `retry-after`. A take of one unit does not get this cause, because each policy holds 1 unit or more.
|
|
29
|
+
- 1f638a3: The escape of a text for a regular expression is `escapeRegExp` of `@mark1russell7/text`, the home of the escape functions. The output does not change. Each of the three packages thus has the new dependency `@mark1russell7/text` `^0.0.2`, which has no dependencies.
|
|
30
|
+
- Updated dependencies [bc98f77]
|
|
31
|
+
- Updated dependencies [33510a2]
|
|
32
|
+
- Updated dependencies [11d9084]
|
|
33
|
+
- Updated dependencies [d28ccb5]
|
|
34
|
+
- Updated dependencies [735cfcf]
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
- Updated dependencies [556d0a8]
|
|
37
|
+
- @procedures/client@0.53.0
|
|
38
|
+
- @procedures/collections@0.53.0
|
|
39
|
+
|
|
40
|
+
## 0.52.5
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- 2058f02: The change watchers and the write-conflict retry of `ViewMaterializer` take their delays from `backoffDelay` of `@mark1russell7/service/backoff`. The delays do not change: a test compares each delay with the old formula. The package thus has the new dependency `@mark1russell7/service` `^0.6.5`.
|
|
45
|
+
- Updated dependencies [25a5f44]
|
|
46
|
+
- @procedures/client@0.52.5
|
|
47
|
+
- @procedures/collections@0.52.5
|
|
48
|
+
|
|
49
|
+
## 0.52.4
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- @procedures/client@0.52.4
|
|
54
|
+
- @procedures/collections@0.52.4
|
|
55
|
+
|
|
3
56
|
## 0.52.3
|
|
4
57
|
|
|
5
58
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -777,6 +777,7 @@ await watch.stop();
|
|
|
777
777
|
- **The image before the change.** Set `fullDocumentBeforeChange: "whenAvailable"`. A collection gives the image only with `changeStreamPreAndPostImages: { enabled: true }` (MongoDB 6 or later).
|
|
778
778
|
- **One event at a time.** The events go in the order of the stream. The watcher reads the next event after `onChange` resolves.
|
|
779
779
|
- **The resume token** is the `_id` of the last event after its `onChange` resolved. A batch without events gives the token of the batch. The getter `resumeToken` of the handle gives the token at this time.
|
|
780
|
+
- **The age of the token.** The getter `tokenAgeMs` gives the milliseconds of `clock` since the token last moved to a later cluster time. Before the first move, it counts from the start. The same cluster time again does not move it. A large value on an open watcher tells a stalled feed. The handle of `watchStorageChanges` has the same getter.
|
|
780
781
|
- **No lost change.** After an error of the stream, the watcher waits for the backoff. Then it opens the stream again with `startAfter` and the token. Thus it loses no change and gives no change twice.
|
|
781
782
|
- **An error of `onChange`** has the same backoff. The token stays at the change before, so the same change comes again.
|
|
782
783
|
- **The backoff** starts at `initialDelay` and grows by `backoffMultiplier` to at most `maxDelay`, with `jitter`. A change or a batch without events sets it back to `initialDelay`. The defaults are `ms(250)`, 2, `seconds(30)` and the full jitter, as for `watchStorageChanges`.
|