cross-tab-worker-databus 0.21.25 → 0.21.26

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.
@@ -2091,7 +2091,9 @@ var ReplayManager = class {
2091
2091
  trace;
2092
2092
  onPersistenceError;
2093
2093
  onDispatchError;
2094
- /** Bumped on suspend/stop so in-flight persistence retries are cancelled. */
2094
+ /** Bumped by exactly one statement, in `suspend()` below — which is where the
2095
+ * `generation !== this.retryGeneration` tests throughout this file look for a
2096
+ * cancellation. This class's own `stop()` does not touch the field. */
2095
2097
  retryGeneration = 0;
2096
2098
  pendingReplayPersistence = [];
2097
2099
  persistenceFlushScheduled = false;
@@ -2250,13 +2252,19 @@ var ReplayManager = class {
2250
2252
  this.scheduleRetentionCleanup(this.now() - this.retentionMs);
2251
2253
  }, this.retentionSweepMs);
2252
2254
  }
2253
- /** Stop the periodic retention sweep. */
2255
+ /** Stop the periodic retention sweep. Its only caller in `src/` is `suspend()`,
2256
+ * which chains it at its end — the class is internal (`ReplayManager` appears
2257
+ * nowhere in the barrel), so no consumer reaches this method directly. It
2258
+ * cancels no in-flight work: that is the `retryGeneration` bump in `suspend()`. */
2254
2259
  stop() {
2255
2260
  if (this.retentionTimer) clearInterval(this.retentionTimer);
2256
2261
  this.retentionTimer = null;
2257
2262
  }
2258
- /** Suspend the manager: cancel in-flight persistence retries (so a hidden tab
2259
- * or stopped bus does not keep hammering the store) and stop the sweep. */
2263
+ /** Cancel in-flight persistence retries by superseding their generation, so a
2264
+ * hidden tab or a stopped bus does not keep hammering the store. This is the
2265
+ * field's only writer; the bus reaches it from its two `replayManager.suspend()`
2266
+ * call sites (the cluster's `onSuspend` handler, and `beginStop()`), and this
2267
+ * class's own `stop()` only clears the sweep timer. */
2260
2268
  suspend() {
2261
2269
  this.retryGeneration += 1;
2262
2270
  if (this.hydration) {
@@ -2430,7 +2438,7 @@ var ReplayManager = class {
2430
2438
  });
2431
2439
  }
2432
2440
  /** Run a persistence operation with exponential backoff on transient failure.
2433
- * Bumped `retryGeneration` (suspend/stop) cancels the loop early; a
2441
+ * The `suspend()` bump of `retryGeneration` cancels the loop early; a
2434
2442
  * structurally failing operation throws after `persistenceRetryMaxAttempts`,
2435
2443
  * leaving the ring buffer intact so the bus keeps working. */
2436
2444
  async withPersistenceRetry(persistenceOperation, operation) {
@@ -2586,7 +2594,7 @@ var SDK_VERSION = (
2586
2594
  // declaration's type is `string | undefined` and the export's is `string`
2587
2595
  // (dropping the conditional is TS2322, measured). Recorded here so the leg reads
2588
2596
  // as a shape the harness cannot reach rather than as a case nobody exercised.
2589
- true ? "0.21.25" : ""
2597
+ true ? "0.21.26" : ""
2590
2598
  );
2591
2599
 
2592
2600
  // src/core/data-bus.ts