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.
- package/CHANGELOG.md +23 -0
- package/dist/centrifuge.js +1 -1
- package/dist/{chunk-ORGPJ2CX.js → chunk-LN5O3IR6.js} +15 -7
- package/dist/{chunk-ORGPJ2CX.js.map → chunk-LN5O3IR6.js.map} +2 -2
- package/dist/cjs/centrifuge.cjs +14 -6
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +14 -6
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/replay-manager.d.ts +13 -5
- package/dist/core/replay-manager.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/docs/roadmap.md +7 -0
- package/docs/zh/roadmap.md +8 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -2091,7 +2091,9 @@ var ReplayManager = class {
|
|
|
2091
2091
|
trace;
|
|
2092
2092
|
onPersistenceError;
|
|
2093
2093
|
onDispatchError;
|
|
2094
|
-
/** Bumped
|
|
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
|
-
/**
|
|
2259
|
-
* or stopped bus does not keep hammering the store
|
|
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
|
-
*
|
|
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.
|
|
2597
|
+
true ? "0.21.26" : ""
|
|
2590
2598
|
);
|
|
2591
2599
|
|
|
2592
2600
|
// src/core/data-bus.ts
|