cross-tab-worker-databus 0.20.19 → 0.20.21

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,6 +1316,7 @@ var CrossTabDataBus = class {
1316
1316
  // Monotonic attempt number within one runtime recovery sequence; reset once
1317
1317
  // a transport reopen succeeds so traces can correlate repeated failures.
1318
1318
  recoveryAttempt = 0;
1319
+ recoveryExhausted = false;
1319
1320
  // True while the tab is hidden so an in-flight transport start does not mark
1320
1321
  // the transport ready after suspendTransport() has stopped it.
1321
1322
  suspended = false;
@@ -1923,7 +1924,13 @@ var CrossTabDataBus = class {
1923
1924
  if (now - this.lastRecoveryAt >= this.recoveryCooldownMs) {
1924
1925
  this.lastRecoveryAt = now;
1925
1926
  const attempt = ++this.recoveryAttempt;
1926
- if (attempt > this.recoveryMaxAttempts) return;
1927
+ if (attempt > this.recoveryMaxAttempts) {
1928
+ if (!this.recoveryExhausted) {
1929
+ this.recoveryExhausted = true;
1930
+ this.trace.event({ type: "reliability", operation: "transport_recovery", attempt: this.recoveryMaxAttempts, outcome: "exhausted" });
1931
+ }
1932
+ return;
1933
+ }
1927
1934
  this.trace.event({ type: "reliability", operation: "transport_recovery", attempt, outcome: "scheduled" });
1928
1935
  setTimeout(() => {
1929
1936
  if (this.stopping || !this.started || this.suspended) return;
@@ -2035,6 +2042,7 @@ var CrossTabDataBus = class {
2035
2042
  if (traceAttempt !== void 0) {
2036
2043
  this.trace.event({ type: "reliability", operation: "transport_recovery", attempt: traceAttempt, outcome: "succeeded" });
2037
2044
  this.recoveryAttempt = 0;
2045
+ this.recoveryExhausted = false;
2038
2046
  }
2039
2047
  if (this.startPromise === opening) this.startPromise = null;
2040
2048
  },