cross-tab-worker-databus 0.20.67 → 0.20.68

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.
@@ -321,6 +321,7 @@ var BatchingStorageWriter = class {
321
321
  };
322
322
 
323
323
  // src/core/cluster.ts
324
+ var CLUSTER_PROTOCOL_VERSION = 1;
324
325
  var DEFAULT_HEARTBEAT_INTERVAL_MS = 3e3;
325
326
  var DEFAULT_WORKER_TTL_MS = 1e4;
326
327
  var DEFAULT_STORAGE_PREFIX = "cross-tab-worker-databus";
@@ -750,6 +751,7 @@ var WorkerClusterRuntime = class {
750
751
  topic: this.knownTopics.get(value.topicKey) ?? null
751
752
  })) : [];
752
753
  return {
754
+ protocolVersion: CLUSTER_PROTOCOL_VERSION,
753
755
  coordinated: Boolean(this.storage && this.channel),
754
756
  suspended: this.suspended,
755
757
  currentWorker: { ...this.currentRecord },
@@ -1006,7 +1008,7 @@ var WorkerClusterRuntime = class {
1006
1008
  send(message) {
1007
1009
  if (!this.channel) return false;
1008
1010
  try {
1009
- this.channel.postMessage(message);
1011
+ this.channel.postMessage({ ...message, protocolVersion: CLUSTER_PROTOCOL_VERSION });
1010
1012
  return true;
1011
1013
  } catch {
1012
1014
  return false;
@@ -1918,7 +1920,7 @@ var CrossTabDataBus = class {
1918
1920
  recovery: this.getRecoveryStats(),
1919
1921
  dedup: this.getDedupStats(),
1920
1922
  replay: { enabled: Boolean(this.replayBuffers), topics: this.replayBuffers?.size ?? 0, messages },
1921
- protocol: { unknownMessages: this.cluster.getUnknownMessageStats().count, lastUnknownMessageType: this.cluster.getUnknownMessageStats().lastType },
1923
+ protocol: { version: this.cluster.getSnapshot().protocolVersion, unknownMessages: this.cluster.getUnknownMessageStats().count, lastUnknownMessageType: this.cluster.getUnknownMessageStats().lastType },
1922
1924
  cluster: this.cluster.getSnapshot()
1923
1925
  };
1924
1926
  }