cross-tab-worker-databus 0.21.5 → 0.21.7

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.
@@ -1316,7 +1316,8 @@ var WorkerClusterRuntime = class {
1316
1316
  if (this.releaseHandoffOnUnsubscribe(message)) return;
1317
1317
  break;
1318
1318
  case CONTROL_ACTION.PUBLISH:
1319
- if (message.items && message.items.length > 0) {
1319
+ if (message.items !== void 0) {
1320
+ if (!Array.isArray(message.items) || message.items.length === 0) return;
1320
1321
  if (this.handlers.onPublishBatch) {
1321
1322
  this.handlers.onPublishBatch(message.topic, message.items);
1322
1323
  return;
@@ -1377,6 +1378,7 @@ var WorkerClusterRuntime = class {
1377
1378
  */
1378
1379
  handleRouteReleasedMessage(message) {
1379
1380
  if (message.targetWorkerId !== this.workerId) return;
1381
+ if (createOpaqueKey(message.topic) !== message.topicKey) return;
1380
1382
  const route = this.readRoute(message.topicKey);
1381
1383
  if (!route || this.isStaleRouteRelease(route, message)) return;
1382
1384
  this.assignedTopics.set(message.topicKey, message.topic);
@@ -2516,7 +2518,7 @@ var DedupManager = class {
2516
2518
  };
2517
2519
 
2518
2520
  // src/core/version.ts
2519
- var SDK_VERSION = true ? "0.21.5" : "";
2521
+ var SDK_VERSION = true ? "0.21.7" : "";
2520
2522
 
2521
2523
  // src/core/data-bus.ts
2522
2524
  var DEFAULT_REPLAY_MAX_PER_TOPIC = 100;
@@ -3830,7 +3832,16 @@ var CentrifugeSession = class {
3830
3832
  /** Forward a publication to the transport. Binary payloads take the
3831
3833
  * zero-copy `MESSAGE_BIN` path when `transferable` is enabled; everything
3832
3834
  * else is structured-cloned via `MESSAGE`. An empty topic means the
3833
- * publication carried no channel info and is silently dropped. */
3835
+ * publication carried no channel info and is silently dropped.
3836
+ *
3837
+ * That drop is uncovered and dominated: the connection-level caller tests the
3838
+ * same emptiness before calling, and the subscription-level caller reads the
3839
+ * topic out of a key this session only ever populates from a SUBSCRIBE frame.
3840
+ * Measured — deleting this line leaves all 37 test files green, and the frame
3841
+ * it withholds could not be delivered anyway, because `topicMatchesPattern`
3842
+ * answers false for an empty topic against both `*` and `prefix.*` (so no
3843
+ * wildcard handler sees it either) and `subscribe('')` throws. Kept as the
3844
+ * boundary statement, not counted as a closed leg. */
3834
3845
  postPublication(topic, data) {
3835
3846
  if (!topic) return;
3836
3847
  if (this.transferable && data instanceof ArrayBuffer) {