cross-tab-worker-databus 0.21.4 → 0.21.6

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.
@@ -1266,6 +1266,7 @@ var WorkerClusterRuntime = class {
1266
1266
  /** Handle a point-to-point CONTROL message (SUBSCRIBE / UNSUBSCRIBE / PUBLISH). */
1267
1267
  handleControlMessage(message) {
1268
1268
  if (message.targetWorkerId !== this.workerId) return;
1269
+ if (message.topicKey !== void 0 && createOpaqueKey(message.topic) !== message.topicKey) return;
1269
1270
  this.rememberTopic(message.topic);
1270
1271
  switch (message.action) {
1271
1272
  case CONTROL_ACTION.SUBSCRIBE: {
@@ -1282,7 +1283,8 @@ var WorkerClusterRuntime = class {
1282
1283
  if (this.releaseHandoffOnUnsubscribe(message)) return;
1283
1284
  break;
1284
1285
  case CONTROL_ACTION.PUBLISH:
1285
- if (message.items && message.items.length > 0) {
1286
+ if (message.items !== void 0) {
1287
+ if (!Array.isArray(message.items) || message.items.length === 0) return;
1286
1288
  if (this.handlers.onPublishBatch) {
1287
1289
  this.handlers.onPublishBatch(message.topic, message.items);
1288
1290
  return;
@@ -1343,6 +1345,7 @@ var WorkerClusterRuntime = class {
1343
1345
  */
1344
1346
  handleRouteReleasedMessage(message) {
1345
1347
  if (message.targetWorkerId !== this.workerId) return;
1348
+ if (createOpaqueKey(message.topic) !== message.topicKey) return;
1346
1349
  const route = this.readRoute(message.topicKey);
1347
1350
  if (!route || this.isStaleRouteRelease(route, message)) return;
1348
1351
  this.assignedTopics.set(message.topicKey, message.topic);
@@ -2482,7 +2485,7 @@ var DedupManager = class {
2482
2485
  };
2483
2486
 
2484
2487
  // src/core/version.ts
2485
- var SDK_VERSION = true ? "0.21.4" : "";
2488
+ var SDK_VERSION = true ? "0.21.6" : "";
2486
2489
 
2487
2490
  // src/core/data-bus.ts
2488
2491
  var DEFAULT_REPLAY_MAX_PER_TOPIC = 100;
@@ -3542,7 +3545,6 @@ var CrossTabDataBus = class {
3542
3545
  }
3543
3546
  }
3544
3547
  );
3545
- void opening.catch(() => void 0);
3546
3548
  return opening;
3547
3549
  }
3548
3550
  /**