bitfab 0.64.12 → 0.64.13

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
@@ -3996,7 +3996,7 @@ interface CommitRef {
3996
3996
  /**
3997
3997
  * SDK version from package.json (injected at build time)
3998
3998
  */
3999
- declare const __version__ = "0.64.12";
3999
+ declare const __version__ = "0.64.13";
4000
4000
 
4001
4001
  /**
4002
4002
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -3996,7 +3996,7 @@ interface CommitRef {
3996
3996
  /**
3997
3997
  * SDK version from package.json (injected at build time)
3998
3998
  */
3999
- declare const __version__ = "0.64.12";
3999
+ declare const __version__ = "0.64.13";
4000
4000
 
4001
4001
  /**
4002
4002
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  getCurrentTrace,
37
37
  reseedFromRegistry,
38
38
  seedFromRegistry
39
- } from "./chunk-ENDINEUP.js";
39
+ } from "./chunk-MRGSDZVX.js";
40
40
  import "./chunk-YWXQM6J3.js";
41
41
  import {
42
42
  BITFAB_PROGRESS_PREFIX,
@@ -45,7 +45,7 @@ import {
45
45
  ReplayError,
46
46
  reportReplayProgress,
47
47
  serializeReplayResult
48
- } from "./chunk-N63C4XC6.js";
48
+ } from "./chunk-K64TGFIC.js";
49
49
  import {
50
50
  BitfabError,
51
51
  DEFAULT_SERVICE_URL,
@@ -53,7 +53,7 @@ import {
53
53
  MixedTracingError,
54
54
  __version__,
55
55
  flushTraces
56
- } from "./chunk-3T32S5N7.js";
56
+ } from "./chunk-NZWWPT76.js";
57
57
  import "./chunk-MT36GJMW.js";
58
58
  export {
59
59
  AssertionCategoriesClient,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.64.12";
100
+ __version__ = "0.64.13";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -4657,7 +4657,7 @@ async function processItem(httpClient, serverItem, fn, experimentId, mockStrateg
4657
4657
  dbBranchTimings: dbBranchTimings ?? null
4658
4658
  };
4659
4659
  }
4660
- async function waitForReplayPersistence(httpClient, experimentId, replayedTraceIds) {
4660
+ async function waitForReplayPersistence(httpClient, experimentId, replayedTraceIds, replayLabels = {}, warn2 = console.warn) {
4661
4661
  const deferredSettled = await httpClient.settleDeferredWork(
4662
4662
  REPLAY_PERSISTENCE_TIMEOUT_MS
4663
4663
  );
@@ -4690,7 +4690,7 @@ async function waitForReplayPersistence(httpClient, experimentId, replayedTraceI
4690
4690
  return readBackTraceIds;
4691
4691
  }
4692
4692
  const deadline = Date.now() + REPLAY_PERSISTENCE_TIMEOUT_MS;
4693
- let missing = Object.keys(expectedSpanCounts).length;
4693
+ let missing = Object.keys(expectedSpanCounts);
4694
4694
  while (true) {
4695
4695
  const status = await httpClient.getReplayStatus(
4696
4696
  experimentId,
@@ -4700,8 +4700,8 @@ async function waitForReplayPersistence(httpClient, experimentId, replayedTraceI
4700
4700
  Object.assign(readBackTraceIds, ready);
4701
4701
  missing = Object.keys(expectedSpanCounts).filter(
4702
4702
  (traceId) => ready[traceId] === void 0
4703
- ).length;
4704
- if (missing === 0) {
4703
+ );
4704
+ if (missing.length === 0) {
4705
4705
  return readBackTraceIds;
4706
4706
  }
4707
4707
  if (Date.now() >= deadline) {
@@ -4711,10 +4711,19 @@ async function waitForReplayPersistence(httpClient, experimentId, replayedTraceI
4711
4711
  Math.min(100, Math.max(0, deadline - Date.now()))
4712
4712
  );
4713
4713
  }
4714
- const cause = flushed ? "" : " Delivery was also not confirmed before the flush deadline, so the spans likely never reached the server.";
4715
- throw new BitfabError(
4716
- `Replay traces were not fully persisted before the delivery deadline (experiment ${experimentId}, missing ${missing} of ${Object.keys(expectedSpanCounts).length} trace(s)).${cause}`
4717
- );
4714
+ for (const traceId of missing) {
4715
+ warn2(
4716
+ unconfirmedReplayWarning(
4717
+ replayLabels[traceId] ?? traceId,
4718
+ REPLAY_PERSISTENCE_TIMEOUT_MS / 1e3,
4719
+ flushed
4720
+ )
4721
+ );
4722
+ }
4723
+ return readBackTraceIds;
4724
+ }
4725
+ function unconfirmedReplayWarning(label, seconds, flushed) {
4726
+ return `[bitfab] replay ${label} could not confirm all spans reached Bitfab within ${seconds}s. The run continues; Bitfab will show this replay as capture incomplete.${flushed ? "" : " Some spans likely never left this process."}`;
4718
4727
  }
4719
4728
  function sleepForReplayPersistence(ms) {
4720
4729
  return new Promise((resolve) => {
@@ -5117,7 +5126,17 @@ async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxC
5117
5126
  }
5118
5127
  throwIfInterrupted(interrupted, resultItems, experimentId, fullExperimentUrl);
5119
5128
  const deliveredTraceIds = await preserveReplayFailure(
5120
- () => waitForReplayPersistence(httpClient, experimentId, replayedTraceIds),
5129
+ () => waitForReplayPersistence(
5130
+ httpClient,
5131
+ experimentId,
5132
+ replayedTraceIds,
5133
+ Object.fromEntries(
5134
+ workItems.map(({ serverItem, attempt }, index) => [
5135
+ replayedTraceIds[index],
5136
+ `${serverItem.originalTraceId ?? serverItem.sourceTraceId}#${attempt}`
5137
+ ])
5138
+ )
5139
+ ),
5121
5140
  resultItems,
5122
5141
  experimentId,
5123
5142
  fullExperimentUrl