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.
@@ -672,6 +672,18 @@ var WorkerClusterRuntime = class {
672
672
  this.routeOwnerCache.delete(oldest);
673
673
  }
674
674
  }
675
+ // Concrete topic → the local wildcard pattern that matched it, or `null` for
676
+ // "scanned, nothing matched". UNLIKE the reverse cache below, this map has no cap:
677
+ // it grows one entry per distinct topic this worker publishes, and is cleared only
678
+ // on the two lifecycle teardowns whose `routeOwnerCache.clear()` sits beside each
679
+ // `wildcardPublishCache.clear()`. Measured: 1,200 `publish()` calls on distinct
680
+ // topic names leave `knownTopics` at its 500-entry cap and this map holding 1,200.
681
+ // A cap is not free here, because both halves decide something. Evicting a pattern
682
+ // re-runs the first local dispatch the entry exists to prevent. Evicting a `null`
683
+ // re-scans, and if a wildcard was assigned in the meantime that publication
684
+ // dispatches locally instead of routing by owner — the fan-out a first publication
685
+ // gets. So bounding this map needs a rule about which of the two may be forgotten,
686
+ // not a number; until one is chosen the growth is the honest cost of the memo.
675
687
  wildcardPublishCache = /* @__PURE__ */ new Map();
676
688
  // Reverse mapping: opaque topicKey → plaintext topic. A bounded cache with
677
689
  // FIFO eviction — NOT authoritative. It can hold a topicKey that is also in
@@ -1828,7 +1840,7 @@ var DataBusTraceReporter = class {
1828
1840
  *
1829
1841
  * Do not add a `|| this.stopped` back at a call site. `getMetrics` and `flush`
1830
1842
  * each carried one, and the repetition is what made this term look untestable:
1831
- * deleting the term left all 37 test files green, because a read of a field the
1843
+ * deleting the term left the whole suite green, because a read of a field the
1832
1844
  * guard consulted one expression earlier can never be the decider. With both
1833
1845
  * repeats gone the same deletion dies twice in `tests/trace.test.ts` — to
1834
1846
  * "starts a fresh metrics window after pause and resume, and stop prevents later
@@ -2499,7 +2511,7 @@ var SDK_VERSION = (
2499
2511
  // declaration's type is `string | undefined` and the export's is `string`
2500
2512
  // (dropping the conditional is TS2322, measured). Recorded here so the leg reads
2501
2513
  // as a shape the harness cannot reach rather than as a case nobody exercised.
2502
- true ? "0.21.29" : ""
2514
+ true ? "0.21.31" : ""
2503
2515
  );
2504
2516
 
2505
2517
  // src/core/data-bus.ts
@@ -3739,4 +3751,4 @@ export {
3739
3751
  parseDataBusPublication,
3740
3752
  selectWorkerBackend
3741
3753
  };
3742
- //# sourceMappingURL=chunk-KYXKYVDT.js.map
3754
+ //# sourceMappingURL=chunk-M4RO3MVX.js.map