cross-tab-worker-databus 0.20.90 → 0.20.91
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 +13 -0
- package/dist/centrifuge-session.d.ts.map +1 -1
- package/dist/centrifuge.js +7 -9
- package/dist/centrifuge.js.map +2 -2
- package/dist/centrifuge.shared.worker.js +6 -8
- package/dist/centrifuge.shared.worker.js.map +2 -2
- package/dist/centrifuge.worker.js +6 -8
- package/dist/centrifuge.worker.js.map +2 -2
- package/dist/{chunk-L24ETFVK.js → chunk-DMM5KBNG.js} +9 -6
- package/dist/chunk-DMM5KBNG.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +14 -13
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +18 -6
- 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/index.js +11 -2
- package/dist/index.js.map +2 -2
- package/dist/websocket.d.ts +3 -0
- package/dist/websocket.d.ts.map +1 -1
- package/docs/architecture.md +2 -0
- package/docs/benchmarks.md +8 -8
- package/docs/roadmap.md +10 -1
- package/docs/zh/architecture.md +2 -0
- package/docs/zh/benchmarks.md +8 -8
- package/docs/zh/roadmap.md +10 -1
- package/package.json +1 -1
- package/dist/chunk-L24ETFVK.js.map +0 -7
|
@@ -723,10 +723,12 @@ var WorkerClusterRuntime = class {
|
|
|
723
723
|
const channel = this.channel;
|
|
724
724
|
this.channel = null;
|
|
725
725
|
this.handlers.onSuspend?.();
|
|
726
|
-
if (
|
|
727
|
-
globalThis.setTimeout
|
|
728
|
-
|
|
729
|
-
|
|
726
|
+
if (channel) {
|
|
727
|
+
if (typeof globalThis.setTimeout === "function") {
|
|
728
|
+
globalThis.setTimeout(() => channel.close(), 0);
|
|
729
|
+
} else {
|
|
730
|
+
channel.close();
|
|
731
|
+
}
|
|
730
732
|
}
|
|
731
733
|
}
|
|
732
734
|
/** Update the worker's connection status and persist the change. */
|
|
@@ -2210,7 +2212,7 @@ var DedupManager = class {
|
|
|
2210
2212
|
};
|
|
2211
2213
|
|
|
2212
2214
|
// src/core/version.ts
|
|
2213
|
-
var SDK_VERSION = true ? "0.20.
|
|
2215
|
+
var SDK_VERSION = true ? "0.20.91" : "";
|
|
2214
2216
|
|
|
2215
2217
|
// src/core/data-bus.ts
|
|
2216
2218
|
var DEFAULT_REPLAY_MAX_PER_TOPIC = 100;
|
|
@@ -2392,6 +2394,7 @@ var CrossTabDataBus = class {
|
|
|
2392
2394
|
// own broadcastEvent call, which always posts a DataBusMessage.
|
|
2393
2395
|
onEvent: (eventType, payload, _sourceWorkerId, originTabId) => {
|
|
2394
2396
|
if (eventType !== PUBLICATION_EVENT) return;
|
|
2397
|
+
if (typeof payload !== "object" || payload === null || typeof payload.topic !== "string") return;
|
|
2395
2398
|
const incoming = payload;
|
|
2396
2399
|
const message = incoming.originTabId !== void 0 ? incoming : originTabId !== void 0 ? { ...incoming, originTabId } : incoming;
|
|
2397
2400
|
if (this.cluster.hasLocalSubscriber(message.topic)) this.dispatch(message);
|
|
@@ -3342,4 +3345,4 @@ export {
|
|
|
3342
3345
|
parseDataBusPublication,
|
|
3343
3346
|
selectWorkerBackend
|
|
3344
3347
|
};
|
|
3345
|
-
//# sourceMappingURL=chunk-
|
|
3348
|
+
//# sourceMappingURL=chunk-DMM5KBNG.js.map
|