@bitfab/sdk 0.62.0 → 0.62.1

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/dist/index.d.cts CHANGED
@@ -3850,7 +3850,7 @@ interface CommitRef {
3850
3850
  /**
3851
3851
  * SDK version from package.json (injected at build time)
3852
3852
  */
3853
- declare const __version__ = "0.62.0";
3853
+ declare const __version__ = "0.62.1";
3854
3854
 
3855
3855
  /**
3856
3856
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -3850,7 +3850,7 @@ interface CommitRef {
3850
3850
  /**
3851
3851
  * SDK version from package.json (injected at build time)
3852
3852
  */
3853
- declare const __version__ = "0.62.0";
3853
+ declare const __version__ = "0.62.1";
3854
3854
 
3855
3855
  /**
3856
3856
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  getCurrentTrace,
27
27
  reseedFromRegistry,
28
28
  seedFromRegistry
29
- } from "./chunk-DFDULVVB.js";
29
+ } from "./chunk-A5ACPLO3.js";
30
30
  import "./chunk-K4XCWQBC.js";
31
31
  import {
32
32
  BITFAB_PROGRESS_PREFIX,
@@ -35,7 +35,7 @@ import {
35
35
  ReplayError,
36
36
  reportReplayProgress,
37
37
  serializeReplayResult
38
- } from "./chunk-HFXOZYGX.js";
38
+ } from "./chunk-XMTPGVK2.js";
39
39
  import {
40
40
  BitfabError,
41
41
  DEFAULT_SERVICE_URL,
@@ -43,7 +43,7 @@ import {
43
43
  MixedTracingError,
44
44
  __version__,
45
45
  flushTraces
46
- } from "./chunk-TI7NSDRZ.js";
46
+ } from "./chunk-IPV4QUWI.js";
47
47
  import "./chunk-BAOIRE5T.js";
48
48
  export {
49
49
  AssertionCategoriesClient,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.62.0";
91
+ __version__ = "0.62.1";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -3704,12 +3704,13 @@ function installReplayInterruptHandlers(target) {
3704
3704
  const removeHandlers = () => {
3705
3705
  for (const [signal, handler] of handlers) {
3706
3706
  host.removeListener(signal, handler);
3707
+ replayListeners.delete(handler);
3707
3708
  }
3708
3709
  handlers.clear();
3709
3710
  };
3710
3711
  let interrupting = false;
3711
3712
  const handleSignal = async (signal) => {
3712
- const hostHandlesSignal = host.listenerCount(signal) > 1;
3713
+ const hostHandlesSignal = host.listeners(signal).some((listener) => !replayListeners.has(listener));
3713
3714
  const markedInterrupted = await target.interrupt();
3714
3715
  removeHandlers();
3715
3716
  if (target.onInterrupt !== void 0) {
@@ -3738,11 +3739,12 @@ function installReplayInterruptHandlers(target) {
3738
3739
  void handleSignal(signal);
3739
3740
  };
3740
3741
  handlers.set(signal, handler);
3742
+ replayListeners.add(handler);
3741
3743
  host.on(signal, handler);
3742
3744
  }
3743
3745
  return { remove: removeHandlers, interrupted: () => interrupting };
3744
3746
  }
3745
- var REPLAY_INTERRUPT_SIGNALS;
3747
+ var REPLAY_INTERRUPT_SIGNALS, replayListeners;
3746
3748
  var init_replayInterrupt = __esm({
3747
3749
  "src/replayInterrupt.ts"() {
3748
3750
  "use strict";
@@ -3750,6 +3752,7 @@ var init_replayInterrupt = __esm({
3750
3752
  "SIGINT",
3751
3753
  "SIGTERM"
3752
3754
  ];
3755
+ replayListeners = /* @__PURE__ */ new Set();
3753
3756
  }
3754
3757
  });
3755
3758
 
@@ -4581,11 +4584,11 @@ function sleepForReplayPersistence(ms) {
4581
4584
  setTimeout(resolve, ms);
4582
4585
  });
4583
4586
  }
4584
- async function mapWithConcurrency2(tasks, maxConcurrency, onSettled, onStarted) {
4587
+ async function mapWithConcurrency2(tasks, maxConcurrency, onSettled, onStarted, shouldStop) {
4585
4588
  const results = new Array(tasks.length);
4586
4589
  let nextIndex = 0;
4587
4590
  async function worker() {
4588
- while (nextIndex < tasks.length) {
4591
+ while (nextIndex < tasks.length && shouldStop?.() !== true) {
4589
4592
  const index = nextIndex++;
4590
4593
  onStarted?.(index);
4591
4594
  const result = await tasks[index]();
@@ -4598,7 +4601,7 @@ async function mapWithConcurrency2(tasks, maxConcurrency, onSettled, onStarted)
4598
4601
  () => worker()
4599
4602
  );
4600
4603
  await Promise.all(workers);
4601
- return results;
4604
+ return results.slice(0, nextIndex);
4602
4605
  }
4603
4606
  async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, registeredOverrides = []) {
4604
4607
  if (options?.resume !== void 0) {
@@ -4913,9 +4916,11 @@ async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxC
4913
4916
  });
4914
4917
  } catch {
4915
4918
  }
4916
- } : void 0
4919
+ } : void 0,
4920
+ interrupted
4917
4921
  );
4918
4922
  const resultItems = [...carriedOverItems, ...ranItems];
4923
+ throwIfInterrupted(interrupted, resultItems, experimentId, fullExperimentUrl);
4919
4924
  if (options?.dryRun === true) {
4920
4925
  throwIfInterrupted(
4921
4926
  interrupted,