bitfab 0.36.8 → 0.36.9

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.
@@ -16,7 +16,7 @@ import {
16
16
  toJsonSafe,
17
17
  toJsonSafeReport,
18
18
  warnOnce
19
- } from "./chunk-QUX6N7ON.js";
19
+ } from "./chunk-MBKY42QC.js";
20
20
 
21
21
  // src/processorPayload.ts
22
22
  var SERIALIZATION_DEGRADED_STEP = "serialization_degraded";
@@ -3371,7 +3371,7 @@ var Bitfab = class {
3371
3371
  `Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
3372
3372
  );
3373
3373
  }
3374
- const { replay: doReplay } = await import("./replay-7PUB6ZOG.js");
3374
+ const { replay: doReplay } = await import("./replay-MH5QFXET.js");
3375
3375
  return doReplay(
3376
3376
  this.httpClient,
3377
3377
  this.serviceUrl,
@@ -3609,4 +3609,4 @@ export {
3609
3609
  BitfabFunction,
3610
3610
  finalizers
3611
3611
  };
3612
- //# sourceMappingURL=chunk-B4HK3BPE.js.map
3612
+ //# sourceMappingURL=chunk-TJAFKZ4X.js.map
package/dist/index.cjs CHANGED
@@ -51,7 +51,7 @@ var __version__;
51
51
  var init_version_generated = __esm({
52
52
  "src/version.generated.ts"() {
53
53
  "use strict";
54
- __version__ = "0.36.8";
54
+ __version__ = "0.36.9";
55
55
  }
56
56
  });
57
57
 
@@ -2364,6 +2364,7 @@ __export(replay_exports, {
2364
2364
  replay: () => replay,
2365
2365
  reportReplayProgress: () => reportReplayProgress,
2366
2366
  serializeReplayResult: () => serializeReplayResult,
2367
+ sleepForReplayPersistence: () => sleepForReplayPersistence,
2367
2368
  waitForReplayPersistence: () => waitForReplayPersistence
2368
2369
  });
2369
2370
  function dbBranchEnabled(dbBranch) {
@@ -2692,17 +2693,18 @@ async function waitForReplayPersistence(httpClient, testRunId, replayedTraceIds)
2692
2693
  if (Date.now() >= deadline) {
2693
2694
  break;
2694
2695
  }
2695
- await sleep(Math.min(100, Math.max(0, deadline - Date.now())));
2696
+ await sleepForReplayPersistence(
2697
+ Math.min(100, Math.max(0, deadline - Date.now()))
2698
+ );
2696
2699
  }
2697
2700
  const cause = flushed ? "" : " Delivery was also not confirmed before the flush deadline, so the spans likely never reached the server.";
2698
2701
  throw new BitfabError(
2699
2702
  `Replay traces were not fully persisted before the delivery deadline (testRunId ${testRunId}, missing ${missing} of ${Object.keys(expectedSpanCounts).length} trace(s)).${cause}`
2700
2703
  );
2701
2704
  }
2702
- function sleep(ms) {
2705
+ function sleepForReplayPersistence(ms) {
2703
2706
  return new Promise((resolve) => {
2704
- const timer = setTimeout(resolve, ms);
2705
- unrefTimer(timer);
2707
+ setTimeout(resolve, ms);
2706
2708
  });
2707
2709
  }
2708
2710
  async function mapWithConcurrency2(tasks, maxConcurrency, onSettled, onStarted) {
@@ -2981,7 +2983,6 @@ var init_replay = __esm({
2981
2983
  init_randomUuid();
2982
2984
  init_replayContext();
2983
2985
  init_serialize();
2984
- init_unrefTimer();
2985
2986
  REPLAY_PERSISTENCE_TIMEOUT_MS = 3e4;
2986
2987
  BITFAB_PROGRESS_PREFIX = "@@bitfab:progress ";
2987
2988
  ReplayError = class extends BitfabError {