@applitools/eyes-storybook 3.64.3 → 3.64.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.64.4](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.64.3...js/eyes-storybook@3.64.4) (2026-03-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * context cleanup before timeout ([#3416](https://github.com/Applitools-Dev/sdk/issues/3416)) ([66afafb](https://github.com/Applitools-Dev/sdk/commit/66afafb5f2962b6b8a5193356cb3f4d32f3c486c))
9
+ * improve page replenishment logic in renderStories | FLD-4200 ([#3602](https://github.com/Applitools-Dev/sdk/issues/3602)) ([a7b3148](https://github.com/Applitools-Dev/sdk/commit/a7b31485382f4f366c87806a864cc8e9a7f85715))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * @applitools/dom-capture bumped to 11.6.10
15
+ #### Bug Fixes
16
+
17
+ * handle empty data URLs in CSS extraction | FLD-4158 ([#3606](https://github.com/Applitools-Dev/sdk/issues/3606)) ([8adef70](https://github.com/Applitools-Dev/sdk/commit/8adef702c7136b0b4a15f150b3d7ca6f649b30a2))
18
+ * @applitools/core bumped to 4.57.1
19
+ #### Bug Fixes
20
+
21
+ * remove checkNetwork from public API, add unit tests ([#3598](https://github.com/Applitools-Dev/sdk/issues/3598)) ([d0a70a3](https://github.com/Applitools-Dev/sdk/commit/d0a70a3b7319aab6e1ca9dbca5e6a94069955447))
22
+
23
+
24
+
25
+ * @applitools/eyes bumped to 1.38.7
26
+
27
+
3
28
  ## [3.64.3](https://github.com/Applitools-Dev/sdk/compare/js/eyes-storybook@3.64.2...js/eyes-storybook@3.64.3) (2026-03-02)
4
29
 
5
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-storybook",
3
- "version": "3.64.3",
3
+ "version": "3.64.4",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "applitools",
@@ -59,9 +59,9 @@
59
59
  "up:framework": "cd test/fixtures/storybook-versions/${APPLITOOLS_FRAMEWORK_VERSION} && npm ci"
60
60
  },
61
61
  "dependencies": {
62
- "@applitools/core": "4.57.0",
62
+ "@applitools/core": "4.57.1",
63
63
  "@applitools/driver": "1.25.1",
64
- "@applitools/eyes": "1.38.6",
64
+ "@applitools/eyes": "1.38.7",
65
65
  "@applitools/functional-commons": "1.6.0",
66
66
  "@applitools/logger": "2.2.8",
67
67
  "@applitools/monitoring-commons": "1.0.19",
@@ -250,7 +250,11 @@ async function eyesStorybook({
250
250
  async function getStoriesWithSpinner() {
251
251
  let firstAttemptContext;
252
252
  let secondAttemptContext;
253
+ let secondAttemptTimer;
254
+ let winnerFound = false;
253
255
  async function attemptNavigate(timeout, waitUntil, isSecondAttempt = false) {
256
+ // If a winner was already found, avoid creating a new context for the second attempt
257
+ if (isSecondAttempt && winnerFound) return {ok: false};
254
258
  const contextObj = await createContext({browser, config, logger});
255
259
  if (isSecondAttempt) secondAttemptContext = contextObj;
256
260
  else firstAttemptContext = contextObj;
@@ -278,7 +282,7 @@ async function eyesStorybook({
278
282
  // Start second attempt after 30 seconds with 2x timeout
279
283
  const secondAttempt = enableTimeoutRetryMechanism
280
284
  ? new Promise(resolve => {
281
- setTimeout(() => {
285
+ secondAttemptTimer = setTimeout(() => {
282
286
  attemptNavigate(readStoriesTimeout * 2, navigationWaitUntil, true).then(resolve);
283
287
  }, timeoutRetry);
284
288
  })
@@ -323,6 +327,7 @@ async function eyesStorybook({
323
327
  }
324
328
 
325
329
  async function cleanupContext(winnerPage) {
330
+ if (secondAttemptTimer) clearTimeout(secondAttemptTimer);
326
331
  if (winnerPage === firstAttemptContext?.page && secondAttemptContext) {
327
332
  try {
328
333
  await secondAttemptContext.page.close();
@@ -345,6 +350,7 @@ async function eyesStorybook({
345
350
  // Wait for the first successful navigation
346
351
  return Promise.race([firstAttempt, secondAttempt]).then(async result => {
347
352
  if (result.ok) {
353
+ winnerFound = true;
348
354
  await cleanupContext(result.page);
349
355
  return handleReadStories(result.page);
350
356
  }
@@ -352,6 +358,7 @@ async function eyesStorybook({
352
358
  return Promise.all([firstAttempt, secondAttempt]).then(async results => {
353
359
  const success = results.find(r => r.ok);
354
360
  if (success) {
361
+ winnerFound = true;
355
362
  await cleanupContext(success.page);
356
363
  return handleReadStories(success.page);
357
364
  }
@@ -67,15 +67,17 @@ function makeRenderStories({
67
67
  `[sparePages] new page ${pageId} is corrupted. preparing new page.`,
68
68
  errorInSanity,
69
69
  );
70
- // If the page is corrupted, we close it and try again immediately (in the finally block)
70
+ // If the page is corrupted, we close it and try again below
71
71
  page.close().catch(() => {});
72
72
  }
73
73
  } finally {
74
74
  this.isPreparing = false;
75
- // If we are still empty, try again
76
- if (this.queue.length === 0) {
77
- this.replenish();
78
- }
75
+ }
76
+ // If we are still empty (sanity check failed), try again.
77
+ // Note: this runs only when createPage succeeded but sanityCheck failed,
78
+ // because a failed createPage returns early above.
79
+ if (this.queue.length === 0) {
80
+ this.replenish();
79
81
  }
80
82
  },
81
83
  };