cross-tab-worker-databus 0.21.29 → 0.21.31
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 +50 -0
- package/dist/centrifuge-session.d.ts +1 -1
- package/dist/centrifuge.js +2 -2
- package/dist/centrifuge.js.map +1 -1
- package/dist/centrifuge.shared.worker.js +1 -1
- package/dist/centrifuge.shared.worker.js.map +1 -1
- package/dist/centrifuge.worker.js +1 -1
- package/dist/centrifuge.worker.js.map +1 -1
- package/dist/{chunk-KYXKYVDT.js → chunk-M4RO3MVX.js} +15 -3
- package/dist/chunk-M4RO3MVX.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +15 -3
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +14 -2
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/data-bus.d.ts.map +1 -1
- package/dist/core/environment.d.ts.map +1 -1
- package/dist/core/trace.d.ts +1 -1
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/docs/architecture.md +2 -0
- package/docs/release-checklist.md +4 -2
- package/docs/roadmap.md +20 -2
- package/docs/zh/architecture.md +2 -0
- package/docs/zh/release-checklist.md +4 -2
- package/docs/zh/roadmap.md +20 -2
- package/package.json +1 -1
- package/dist/chunk-KYXKYVDT.js.map +0 -7
package/dist/cjs/centrifuge.cjs
CHANGED
|
@@ -801,6 +801,18 @@ var WorkerClusterRuntime = class {
|
|
|
801
801
|
this.routeOwnerCache.delete(oldest);
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
+
// Concrete topic → the local wildcard pattern that matched it, or `null` for
|
|
805
|
+
// "scanned, nothing matched". UNLIKE the reverse cache below, this map has no cap:
|
|
806
|
+
// it grows one entry per distinct topic this worker publishes, and is cleared only
|
|
807
|
+
// on the two lifecycle teardowns whose `routeOwnerCache.clear()` sits beside each
|
|
808
|
+
// `wildcardPublishCache.clear()`. Measured: 1,200 `publish()` calls on distinct
|
|
809
|
+
// topic names leave `knownTopics` at its 500-entry cap and this map holding 1,200.
|
|
810
|
+
// A cap is not free here, because both halves decide something. Evicting a pattern
|
|
811
|
+
// re-runs the first local dispatch the entry exists to prevent. Evicting a `null`
|
|
812
|
+
// re-scans, and if a wildcard was assigned in the meantime that publication
|
|
813
|
+
// dispatches locally instead of routing by owner — the fan-out a first publication
|
|
814
|
+
// gets. So bounding this map needs a rule about which of the two may be forgotten,
|
|
815
|
+
// not a number; until one is chosen the growth is the honest cost of the memo.
|
|
804
816
|
wildcardPublishCache = /* @__PURE__ */ new Map();
|
|
805
817
|
// Reverse mapping: opaque topicKey → plaintext topic. A bounded cache with
|
|
806
818
|
// FIFO eviction — NOT authoritative. It can hold a topicKey that is also in
|
|
@@ -1957,7 +1969,7 @@ var DataBusTraceReporter = class {
|
|
|
1957
1969
|
*
|
|
1958
1970
|
* Do not add a `|| this.stopped` back at a call site. `getMetrics` and `flush`
|
|
1959
1971
|
* each carried one, and the repetition is what made this term look untestable:
|
|
1960
|
-
* deleting the term left
|
|
1972
|
+
* deleting the term left the whole suite green, because a read of a field the
|
|
1961
1973
|
* guard consulted one expression earlier can never be the decider. With both
|
|
1962
1974
|
* repeats gone the same deletion dies twice in `tests/trace.test.ts` — to
|
|
1963
1975
|
* "starts a fresh metrics window after pause and resume, and stop prevents later
|
|
@@ -2628,7 +2640,7 @@ var SDK_VERSION = (
|
|
|
2628
2640
|
// declaration's type is `string | undefined` and the export's is `string`
|
|
2629
2641
|
// (dropping the conditional is TS2322, measured). Recorded here so the leg reads
|
|
2630
2642
|
// as a shape the harness cannot reach rather than as a case nobody exercised.
|
|
2631
|
-
true ? "0.21.
|
|
2643
|
+
true ? "0.21.31" : ""
|
|
2632
2644
|
);
|
|
2633
2645
|
|
|
2634
2646
|
// src/core/data-bus.ts
|
|
@@ -3985,7 +3997,7 @@ var CentrifugeSession = class {
|
|
|
3985
3997
|
* That drop is uncovered and dominated: the connection-level caller tests the
|
|
3986
3998
|
* same emptiness before calling, and the subscription-level caller reads the
|
|
3987
3999
|
* topic out of a key this session only ever populates from a SUBSCRIBE frame.
|
|
3988
|
-
* Measured — deleting this line leaves
|
|
4000
|
+
* Measured — deleting this line leaves the whole suite green, and the frame
|
|
3989
4001
|
* it withholds has nowhere to land anyway: the only handler registry is the
|
|
3990
4002
|
* DataBus's `topicHandlers`, and every write to it sits behind
|
|
3991
4003
|
* `assertPublicTopic` (at the head of `data-bus.ts`'s `subscribe()`, `publish()`
|