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.
@@ -1057,6 +1057,9 @@ var DataBusTraceReporter = class {
1057
1057
  now;
1058
1058
  intervalHandle = null;
1059
1059
  intervalStartedAt = 0;
1060
+ // A reporter may be flushed explicitly before start(), but once stop() is
1061
+ // called it must remain inert until a new start() begins another session.
1062
+ stopped = false;
1060
1063
  received = 0;
1061
1064
  dispatched = 0;
1062
1065
  latencySamples = 0;
@@ -1079,6 +1082,7 @@ var DataBusTraceReporter = class {
1079
1082
  * (no metrics to emit), when disabled, or when already running. */
1080
1083
  start() {
1081
1084
  if (!this.enabled || this.intervalHandle || this.mode === "events") return;
1085
+ this.stopped = false;
1082
1086
  this.intervalStartedAt = this.now();
1083
1087
  this.intervalHandle = setInterval(() => this.flush(), this.metricsIntervalMs);
1084
1088
  }
@@ -1090,6 +1094,7 @@ var DataBusTraceReporter = class {
1090
1094
  this.resetMetrics();
1091
1095
  }
1092
1096
  stop() {
1097
+ this.stopped = true;
1093
1098
  this.pause();
1094
1099
  }
1095
1100
  /** Record an instantaneous trace event (lifecycle, status, error, etc.). */
@@ -1158,7 +1163,7 @@ var DataBusTraceReporter = class {
1158
1163
  }
1159
1164
  /** Emit the accumulated metrics snapshot if the interval is active. */
1160
1165
  flush() {
1161
- if (!this.metricsActive) return;
1166
+ if (!this.metricsActive || this.stopped) return;
1162
1167
  this.flushNow();
1163
1168
  }
1164
1169
  flushNow() {