cross-tab-worker-databus 0.20.66 → 0.20.67
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 +5 -0
- package/dist/centrifuge.js +1 -1
- package/dist/{chunk-KKSZ5GUC.js → chunk-RJS3M3EE.js} +13 -2
- package/dist/chunk-RJS3M3EE.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +12 -1
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +12 -1
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/cluster.d.ts +7 -0
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/data-bus.d.ts +4 -0
- package/dist/core/data-bus.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/docs/roadmap.md +5 -1
- package/docs/zh/roadmap.md +5 -1
- package/package.json +1 -1
- package/dist/chunk-KKSZ5GUC.js.map +0 -7
package/dist/cjs/index.cjs
CHANGED
|
@@ -381,6 +381,8 @@ var WorkerClusterRuntime = class {
|
|
|
381
381
|
routeOwnerCacheMax;
|
|
382
382
|
routeOwnerCacheHits = 0;
|
|
383
383
|
routeOwnerCacheMisses = 0;
|
|
384
|
+
unknownMessageCount = 0;
|
|
385
|
+
lastUnknownMessageType = null;
|
|
384
386
|
touchRouteOwnerCache(topicKey, value) {
|
|
385
387
|
if (this.routeOwnerCache.has(topicKey)) this.routeOwnerCache.delete(topicKey);
|
|
386
388
|
this.routeOwnerCache.set(topicKey, value);
|
|
@@ -737,6 +739,10 @@ var WorkerClusterRuntime = class {
|
|
|
737
739
|
}
|
|
738
740
|
return false;
|
|
739
741
|
}
|
|
742
|
+
/** Count and last type of unknown protocol messages observed. */
|
|
743
|
+
getUnknownMessageStats() {
|
|
744
|
+
return { count: this.unknownMessageCount, lastType: this.lastUnknownMessageType };
|
|
745
|
+
}
|
|
740
746
|
/** Read-only snapshot of the cluster state (workers, routes, assignments). */
|
|
741
747
|
getSnapshot() {
|
|
742
748
|
const routes = this.storage ? readAllByPrefix(this.storage, this.routePrefix).map(({ value }) => ({
|
|
@@ -800,9 +806,13 @@ var WorkerClusterRuntime = class {
|
|
|
800
806
|
case "REGISTRY":
|
|
801
807
|
this.reconcile();
|
|
802
808
|
return;
|
|
803
|
-
default:
|
|
809
|
+
default: {
|
|
810
|
+
this.unknownMessageCount += 1;
|
|
811
|
+
const unknown = message;
|
|
812
|
+
this.lastUnknownMessageType = typeof unknown.type === "string" ? unknown.type : null;
|
|
804
813
|
this.handlers.onUnknownMessage?.(message);
|
|
805
814
|
return;
|
|
815
|
+
}
|
|
806
816
|
}
|
|
807
817
|
};
|
|
808
818
|
/** Handle a point-to-point CONTROL message (SUBSCRIBE / UNSUBSCRIBE / PUBLISH). */
|
|
@@ -1908,6 +1918,7 @@ var CrossTabDataBus = class {
|
|
|
1908
1918
|
recovery: this.getRecoveryStats(),
|
|
1909
1919
|
dedup: this.getDedupStats(),
|
|
1910
1920
|
replay: { enabled: Boolean(this.replayBuffers), topics: this.replayBuffers?.size ?? 0, messages },
|
|
1921
|
+
protocol: { unknownMessages: this.cluster.getUnknownMessageStats().count, lastUnknownMessageType: this.cluster.getUnknownMessageStats().lastType },
|
|
1911
1922
|
cluster: this.cluster.getSnapshot()
|
|
1912
1923
|
};
|
|
1913
1924
|
}
|