cross-tab-worker-databus 0.20.25 → 0.20.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.
@@ -1082,6 +1082,9 @@ var DataBusTraceReporter = class {
1082
1082
  now;
1083
1083
  intervalHandle = null;
1084
1084
  intervalStartedAt = 0;
1085
+ // A reporter may be flushed explicitly before start(), but once stop() is
1086
+ // called it must remain inert until a new start() begins another session.
1087
+ stopped = false;
1085
1088
  received = 0;
1086
1089
  dispatched = 0;
1087
1090
  latencySamples = 0;
@@ -1104,6 +1107,7 @@ var DataBusTraceReporter = class {
1104
1107
  * (no metrics to emit), when disabled, or when already running. */
1105
1108
  start() {
1106
1109
  if (!this.enabled || this.intervalHandle || this.mode === "events") return;
1110
+ this.stopped = false;
1107
1111
  this.intervalStartedAt = this.now();
1108
1112
  this.intervalHandle = setInterval(() => this.flush(), this.metricsIntervalMs);
1109
1113
  }
@@ -1115,6 +1119,7 @@ var DataBusTraceReporter = class {
1115
1119
  this.resetMetrics();
1116
1120
  }
1117
1121
  stop() {
1122
+ this.stopped = true;
1118
1123
  this.pause();
1119
1124
  }
1120
1125
  /** Record an instantaneous trace event (lifecycle, status, error, etc.). */
@@ -1183,7 +1188,7 @@ var DataBusTraceReporter = class {
1183
1188
  }
1184
1189
  /** Emit the accumulated metrics snapshot if the interval is active. */
1185
1190
  flush() {
1186
- if (!this.metricsActive) return;
1191
+ if (!this.metricsActive || this.stopped) return;
1187
1192
  this.flushNow();
1188
1193
  }
1189
1194
  flushNow() {