cross-tab-worker-databus 0.20.15 → 0.20.17
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 +14 -0
- package/dist/centrifuge.js +1 -1
- package/dist/{chunk-LPS4XOK4.js → chunk-LZ7S62BQ.js} +18 -5
- package/dist/{chunk-LPS4XOK4.js.map → chunk-LZ7S62BQ.js.map} +2 -2
- package/dist/cjs/centrifuge.cjs +17 -4
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +17 -4
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/data-bus.d.ts +1 -0
- package/dist/core/data-bus.d.ts.map +1 -1
- package/dist/core/trace.d.ts +2 -0
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/docs/roadmap.md +11 -1
- package/docs/zh/roadmap.md +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Semantic Versioning](https://semver.org/);变更记录格式参考 [Keep a Changelog](https://keepachangelog.com/)。
|
|
4
4
|
|
|
5
|
+
## [0.20.17] - 2026-09-03
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Consecutive transport recovery traces now carry monotonic attempt numbers and reset after a successful reopen.
|
|
10
|
+
- Added regression coverage for multi-failure recovery sequences.
|
|
11
|
+
|
|
12
|
+
## [0.20.16] - 2026-09-03
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Transport recovery trace events now report `scheduled`, `succeeded`, and `failed` outcomes, making reconnect failures diagnosable without exposing payloads or connection details.
|
|
17
|
+
- Added regression coverage for failed recovery followed by a successful retry.
|
|
18
|
+
|
|
5
19
|
## [0.20.15] - 2026-09-03
|
|
6
20
|
|
|
7
21
|
### Added
|
package/dist/centrifuge.js
CHANGED
|
@@ -1272,6 +1272,9 @@ var CrossTabDataBus = class _CrossTabDataBus {
|
|
|
1272
1272
|
// Timestamp of the last automatic transport recovery attempt.
|
|
1273
1273
|
// Used to avoid a tight retry loop when the transport fails repeatedly.
|
|
1274
1274
|
lastRecoveryAt = 0;
|
|
1275
|
+
// Monotonic attempt number within one runtime recovery sequence; reset once
|
|
1276
|
+
// a transport reopen succeeds so traces can correlate repeated failures.
|
|
1277
|
+
recoveryAttempt = 0;
|
|
1275
1278
|
// True while the tab is hidden so an in-flight transport start does not mark
|
|
1276
1279
|
// the transport ready after suspendTransport() has stopped it.
|
|
1277
1280
|
suspended = false;
|
|
@@ -1869,11 +1872,12 @@ var CrossTabDataBus = class _CrossTabDataBus {
|
|
|
1869
1872
|
const now = this.now();
|
|
1870
1873
|
if (now - this.lastRecoveryAt >= _CrossTabDataBus.RECOVERY_COOLDOWN_MS) {
|
|
1871
1874
|
this.lastRecoveryAt = now;
|
|
1872
|
-
|
|
1875
|
+
const attempt = ++this.recoveryAttempt;
|
|
1876
|
+
this.trace.event({ type: "reliability", operation: "transport_recovery", attempt, outcome: "scheduled" });
|
|
1873
1877
|
setTimeout(() => {
|
|
1874
1878
|
if (this.stopping || !this.started || this.suspended) return;
|
|
1875
1879
|
if (this.status !== "error") return;
|
|
1876
|
-
void this.reopenTransport();
|
|
1880
|
+
void this.reopenTransport(attempt);
|
|
1877
1881
|
}, _CrossTabDataBus.RECOVERY_COOLDOWN_MS);
|
|
1878
1882
|
}
|
|
1879
1883
|
}
|
|
@@ -1964,10 +1968,11 @@ var CrossTabDataBus = class _CrossTabDataBus {
|
|
|
1964
1968
|
* its rejection so the reopen is not blocked. Returns the opening promise so
|
|
1965
1969
|
* callers can queue operations behind it.
|
|
1966
1970
|
*/
|
|
1967
|
-
reopenTransport() {
|
|
1971
|
+
reopenTransport(recoveryAttempt) {
|
|
1968
1972
|
if (this.stopping || this.activeConfig === void 0) return Promise.resolve();
|
|
1969
1973
|
if (this.startPromise && this.startPromise !== this.pendingStop) return this.startPromise;
|
|
1970
1974
|
const config = this.activeConfig;
|
|
1975
|
+
const traceAttempt = recoveryAttempt ?? (this.recoveryAttempt > 0 ? this.recoveryAttempt : void 0);
|
|
1971
1976
|
this.started = true;
|
|
1972
1977
|
this.suspended = false;
|
|
1973
1978
|
this.updateStatus("connecting");
|
|
@@ -1976,9 +1981,17 @@ var CrossTabDataBus = class _CrossTabDataBus {
|
|
|
1976
1981
|
this.startPromise = opening;
|
|
1977
1982
|
void opening.then(
|
|
1978
1983
|
() => {
|
|
1984
|
+
if (traceAttempt !== void 0) {
|
|
1985
|
+
this.trace.event({ type: "reliability", operation: "transport_recovery", attempt: traceAttempt, outcome: "succeeded" });
|
|
1986
|
+
this.recoveryAttempt = 0;
|
|
1987
|
+
}
|
|
1979
1988
|
if (this.startPromise === opening) this.startPromise = null;
|
|
1980
1989
|
},
|
|
1981
|
-
() =>
|
|
1990
|
+
() => {
|
|
1991
|
+
if (traceAttempt !== void 0) {
|
|
1992
|
+
this.trace.event({ type: "reliability", operation: "transport_recovery", attempt: traceAttempt, outcome: "failed" });
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1982
1995
|
);
|
|
1983
1996
|
void opening.catch(() => void 0);
|
|
1984
1997
|
return opening;
|
|
@@ -2078,4 +2091,4 @@ export {
|
|
|
2078
2091
|
parseDataBusPublication,
|
|
2079
2092
|
selectWorkerBackend
|
|
2080
2093
|
};
|
|
2081
|
-
//# sourceMappingURL=chunk-
|
|
2094
|
+
//# sourceMappingURL=chunk-LZ7S62BQ.js.map
|