cross-tab-worker-databus 0.20.65 → 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 +10 -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 +22 -2
- 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/core/replay-persistence.d.ts +2 -0
- package/dist/core/replay-persistence.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +2 -2
- package/docs/roadmap.md +9 -1
- package/docs/zh/roadmap.md +9 -1
- package/package.json +1 -1
- package/dist/chunk-KKSZ5GUC.js.map +0 -7
package/dist/cjs/centrifuge.cjs
CHANGED
|
@@ -356,6 +356,8 @@ var WorkerClusterRuntime = class {
|
|
|
356
356
|
routeOwnerCacheMax;
|
|
357
357
|
routeOwnerCacheHits = 0;
|
|
358
358
|
routeOwnerCacheMisses = 0;
|
|
359
|
+
unknownMessageCount = 0;
|
|
360
|
+
lastUnknownMessageType = null;
|
|
359
361
|
touchRouteOwnerCache(topicKey, value) {
|
|
360
362
|
if (this.routeOwnerCache.has(topicKey)) this.routeOwnerCache.delete(topicKey);
|
|
361
363
|
this.routeOwnerCache.set(topicKey, value);
|
|
@@ -712,6 +714,10 @@ var WorkerClusterRuntime = class {
|
|
|
712
714
|
}
|
|
713
715
|
return false;
|
|
714
716
|
}
|
|
717
|
+
/** Count and last type of unknown protocol messages observed. */
|
|
718
|
+
getUnknownMessageStats() {
|
|
719
|
+
return { count: this.unknownMessageCount, lastType: this.lastUnknownMessageType };
|
|
720
|
+
}
|
|
715
721
|
/** Read-only snapshot of the cluster state (workers, routes, assignments). */
|
|
716
722
|
getSnapshot() {
|
|
717
723
|
const routes = this.storage ? readAllByPrefix(this.storage, this.routePrefix).map(({ value }) => ({
|
|
@@ -775,9 +781,13 @@ var WorkerClusterRuntime = class {
|
|
|
775
781
|
case "REGISTRY":
|
|
776
782
|
this.reconcile();
|
|
777
783
|
return;
|
|
778
|
-
default:
|
|
784
|
+
default: {
|
|
785
|
+
this.unknownMessageCount += 1;
|
|
786
|
+
const unknown = message;
|
|
787
|
+
this.lastUnknownMessageType = typeof unknown.type === "string" ? unknown.type : null;
|
|
779
788
|
this.handlers.onUnknownMessage?.(message);
|
|
780
789
|
return;
|
|
790
|
+
}
|
|
781
791
|
}
|
|
782
792
|
};
|
|
783
793
|
/** Handle a point-to-point CONTROL message (SUBSCRIBE / UNSUBSCRIBE / PUBLISH). */
|
|
@@ -1883,6 +1893,7 @@ var CrossTabDataBus = class {
|
|
|
1883
1893
|
recovery: this.getRecoveryStats(),
|
|
1884
1894
|
dedup: this.getDedupStats(),
|
|
1885
1895
|
replay: { enabled: Boolean(this.replayBuffers), topics: this.replayBuffers?.size ?? 0, messages },
|
|
1896
|
+
protocol: { unknownMessages: this.cluster.getUnknownMessageStats().count, lastUnknownMessageType: this.cluster.getUnknownMessageStats().lastType },
|
|
1886
1897
|
cluster: this.cluster.getSnapshot()
|
|
1887
1898
|
};
|
|
1888
1899
|
}
|