cross-tab-worker-databus 0.21.11 → 0.21.13
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 +23 -0
- package/README.md +2 -2
- package/README.zh.md +3 -1
- package/dist/centrifuge-protocol.d.ts.map +1 -1
- package/dist/centrifuge-session.d.ts +10 -3
- package/dist/centrifuge-session.d.ts.map +1 -1
- package/dist/centrifuge.d.ts +10 -4
- package/dist/centrifuge.d.ts.map +1 -1
- package/dist/centrifuge.js +23 -11
- package/dist/centrifuge.js.map +2 -2
- package/dist/centrifuge.shared.worker.js +28 -11
- package/dist/centrifuge.shared.worker.js.map +2 -2
- package/dist/centrifuge.worker.js +10 -3
- package/dist/centrifuge.worker.js.map +2 -2
- package/dist/{chunk-UO57SLQD.js → chunk-4HW6PYIR.js} +67 -33
- package/dist/chunk-4HW6PYIR.js.map +7 -0
- package/dist/{chunk-2TTJ7LGZ.js → chunk-NPFTD7YE.js} +1 -1
- package/dist/chunk-NPFTD7YE.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +86 -40
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/hooks.cjs.map +2 -2
- package/dist/cjs/index.cjs +80 -36
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/cjs/vue.cjs.map +2 -2
- package/dist/core/cluster.d.ts +33 -16
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/data-bus.d.ts +19 -5
- package/dist/core/data-bus.d.ts.map +1 -1
- package/dist/core/dedup-manager.d.ts +6 -3
- package/dist/core/dedup-manager.d.ts.map +1 -1
- package/dist/core/environment.d.ts +14 -5
- package/dist/core/environment.d.ts.map +1 -1
- package/dist/core/hash.d.ts +10 -4
- package/dist/core/hash.d.ts.map +1 -1
- package/dist/core/replay-manager.d.ts +2 -1
- package/dist/core/replay-manager.d.ts.map +1 -1
- package/dist/core/routing.d.ts +18 -9
- package/dist/core/routing.d.ts.map +1 -1
- package/dist/core/storage-batch.d.ts +2 -2
- package/dist/core/storage-batch.d.ts.map +1 -1
- package/dist/core/trace.d.ts +21 -9
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/core/types.d.ts +13 -5
- package/dist/core/types.d.ts.map +1 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.js.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +2 -2
- package/dist/utils/constants.d.ts +7 -4
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +12 -4
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/vue.js +1 -1
- package/dist/websocket.d.ts +24 -6
- package/dist/websocket.d.ts.map +1 -1
- package/dist/workers/port-reaper.d.ts +18 -8
- package/dist/workers/port-reaper.d.ts.map +1 -1
- package/docs/api.md +6 -5
- package/docs/benchmarks.md +9 -9
- package/docs/release-checklist.md +6 -6
- package/docs/roadmap.md +57 -2
- package/docs/transports.md +3 -2
- package/docs/zh/api.md +6 -5
- package/docs/zh/benchmarks.md +9 -9
- package/docs/zh/release-checklist.md +6 -6
- package/docs/zh/roadmap.md +42 -2
- package/docs/zh/transports.md +2 -1
- package/package.json +2 -1
- package/dist/chunk-2TTJ7LGZ.js.map +0 -7
- package/dist/chunk-UO57SLQD.js.map +0 -7
|
@@ -5251,9 +5251,16 @@ var CentrifugeSession = class {
|
|
|
5251
5251
|
* same emptiness before calling, and the subscription-level caller reads the
|
|
5252
5252
|
* topic out of a key this session only ever populates from a SUBSCRIBE frame.
|
|
5253
5253
|
* Measured — deleting this line leaves all 37 test files green, and the frame
|
|
5254
|
-
* it withholds
|
|
5255
|
-
*
|
|
5256
|
-
*
|
|
5254
|
+
* it withholds has nowhere to land anyway: the only handler registry is the
|
|
5255
|
+
* DataBus's `topicHandlers`, and every write to it sits behind
|
|
5256
|
+
* `assertPublicTopic` (`data-bus.ts:929`, `:1009`, `:1033`), so no `''` key can
|
|
5257
|
+
* exist — while `topicMatchesPattern` answers false for an empty topic against
|
|
5258
|
+
* both `*` and `prefix.*`, so a wildcard handler cannot see it either. Neither
|
|
5259
|
+
* of those is a reason to delete this guard: it is the only one *at this layer*,
|
|
5260
|
+
* because neither the session nor the transport calls `assertPublicTopic` — a
|
|
5261
|
+
* SUBSCRIBE frame naming `''` creates a real Centrifuge subscription
|
|
5262
|
+
* (`newSubscription` does not validate a channel), so the undeliverable
|
|
5263
|
+
* publication would otherwise be posted back to the main thread. Kept as the
|
|
5257
5264
|
* boundary statement, not counted as a closed leg. */
|
|
5258
5265
|
postPublication(topic, data) {
|
|
5259
5266
|
if (!topic) return;
|
|
@@ -5384,12 +5391,19 @@ var PortReaper = class {
|
|
|
5384
5391
|
* `Infinity` is the documented way to disable the PING heartbeat, and it means
|
|
5385
5392
|
* this port can never be judged silent: `startHeartbeat()` sends nothing at all
|
|
5386
5393
|
* once configured that way, so a timeout would be a death sentence with no
|
|
5387
|
-
* possible appeal. A non-finite-or-non-positive *other* value falls back to
|
|
5388
|
-
* default
|
|
5389
|
-
*
|
|
5390
|
-
*
|
|
5391
|
-
*
|
|
5392
|
-
*
|
|
5394
|
+
* possible appeal. A non-finite-or-non-positive *other* value falls back to
|
|
5395
|
+
* the default, which keeps the timeout comparison from degenerating into
|
|
5396
|
+
* "always expired" — a NaN timeout reaps every port on the first tick. Read
|
|
5397
|
+
* that narrowly, because it is not a busy-loop guard: the busy-loop vector is
|
|
5398
|
+
* a tiny *positive* interval, which the ternary passes through untouched
|
|
5399
|
+
* (0.0001 → a 0.0003 ms timeout → every tick reaps everything), and the
|
|
5400
|
+
* reaper's own cadence is bounded elsewhere — `computeMinHeartbeat` starts
|
|
5401
|
+
* from DEFAULT_HEARTBEAT_INTERVAL_MS and only takes a minimum, so a payload
|
|
5402
|
+
* can shorten the sweep but never stretch it past 10 s. The three values
|
|
5403
|
+
* rejected here (NaN, 0, negative) are also rejected by
|
|
5404
|
+
* `assertHeartbeatInterval` at the transport constructor and so can only
|
|
5405
|
+
* arrive from a main thread that is not this library. No-op for untracked
|
|
5406
|
+
* ports (e.g. setTimeout arrives after remove/STOP). */
|
|
5393
5407
|
setTimeout(port, heartbeatIntervalMs) {
|
|
5394
5408
|
if (!this.targets.has(port)) return;
|
|
5395
5409
|
const safe = heartbeatIntervalMs === Infinity ? Infinity : Number.isFinite(heartbeatIntervalMs) && heartbeatIntervalMs > 0 ? heartbeatIntervalMs : DEFAULT_HEARTBEAT_INTERVAL_MS;
|
|
@@ -5439,8 +5453,11 @@ var PortReaper = class {
|
|
|
5439
5453
|
this.handle = this.setTimer(() => this.reap(), minHeartbeat);
|
|
5440
5454
|
}
|
|
5441
5455
|
/** Smallest heartbeat interval among active ports, derived from each port's
|
|
5442
|
-
* configured session timeout.
|
|
5443
|
-
*
|
|
5456
|
+
* configured session timeout. Extracted because `schedule()` derives its delay
|
|
5457
|
+
* from it on every re-arm. Not a test seam: nothing in `tests/` calls it
|
|
5458
|
+
* (grep: zero hits), and the cadence is asserted through the injected
|
|
5459
|
+
* `setTimer` — i.e. through the same plumbing this note used to claim it was
|
|
5460
|
+
* isolated from. */
|
|
5444
5461
|
computeMinHeartbeat() {
|
|
5445
5462
|
let minHeartbeat = DEFAULT_HEARTBEAT_INTERVAL_MS;
|
|
5446
5463
|
for (const timeout of this.sessionTimeoutMs.values()) {
|