@faststore/core 4.11.4-dev.2 → 4.11.4-dev.3

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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @faststore/core@4.11.4-dev.1 generate /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.11.4-dev.2 generate /home/runner/work/faststore/faststore/packages/core
3
3
  > pnpm run gen-types && pnpm run cache-graphql
4
4
 
5
5
 
6
- > @faststore/core@4.11.4-dev.1 gen-types /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@4.11.4-dev.2 gen-types /home/runner/work/faststore/faststore/packages/core
7
7
  > node ../cli/bin/run generate-types .
8
8
 
9
9
  [STARTED] Parse Configuration
@@ -19,7 +19,7 @@
19
19
  [COMPLETED] Generate to @generated/
20
20
  [COMPLETED] Generate outputs
21
21
 
22
- > @faststore/core@4.11.4-dev.1 cache-graphql /home/runner/work/faststore/faststore/packages/core
22
+ > @faststore/core@4.11.4-dev.2 cache-graphql /home/runner/work/faststore/faststore/packages/core
23
23
  > node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
24
24
 
25
25
  [Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
@@ -1,5 +1,5 @@
1
1
 
2
- > @faststore/core@4.11.4-dev.1 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.11.4-dev.2 test /home/runner/work/faststore/faststore/packages/core
3
3
  > vitest run
4
4
 
5
5
 
@@ -7,32 +7,25 @@
7
7
 
8
8
  Not implemented: navigation to another Document
9
9
  Not implemented: navigation to another Document
10
- ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 853ms
10
+ ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 991ms
11
11
  Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
12
12
  npx update-browserslist-db@latest
13
13
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
14
- ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (22 tests) 3961ms
15
- ✓ shows an error state when the list fails to load  789ms
16
- ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  329ms
17
- ✓ keeps Confirm disabled until a different contract is selected  332ms
18
- ✓ keeps Confirm disabled when switching is unavailable  306ms
19
- ✓ keeps Confirm disabled when the selected contract is filtered out  409ms
20
- ✓ honors CMS-provided labels for the header, current session, search, footer, and available count  326ms
21
- ✓ falls back to English defaults when CMS labels are blank  318ms
22
- ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (16 tests) 2664ms
23
- ✓ shows the tab bar and renders Personal cards by default  1387ms
24
- ✓  browser  test/components/account/orders/BuyingPolicyAlert.browser.test.tsx (13 tests) 2347ms
25
- ✓ opens the reject confirmation modal with the default English copy  1041ms
26
- ✓ opens the reject confirmation modal with CMS-provided labels  409ms
27
- ✓  browser  test/components/ui/RichText/RichText.browser.test.tsx (8 tests) 493ms
28
- ✓  browser  test/sdk/product/usePageProductsQuery.browser.test.ts (9 tests) 104ms
29
- ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (10 tests) 1750ms
30
- ✓ renders the menu view with contract details and manage footer  1022ms
31
- ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (6 tests) 23ms
32
- ✓  browser  test/sdk/localization/useBindingSelector.browser.test.tsx (9 tests) 94ms
33
- ✓  browser  test/components/CartRecommendationShelf/CartRecommendationShelf.browser.test.tsx (13 tests) 180ms
34
- ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 78ms
35
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (12 tests) 156ms
14
+ ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (22 tests) 2246ms
15
+ ✓ shows an error state when the list fails to load  501ms
16
+ ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (16 tests) 1654ms
17
+ ✓ shows the tab bar and renders Personal cards by default  844ms
18
+ ✓  browser  test/components/account/orders/BuyingPolicyAlert.browser.test.tsx (13 tests) 1555ms
19
+ ✓ opens the reject confirmation modal with the default English copy  861ms
20
+ ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (10 tests) 1190ms
21
+ ✓ renders the menu view with contract details and manage footer  671ms
22
+ ✓  browser  test/components/ui/RichText/RichText.browser.test.tsx (8 tests) 290ms
23
+ ✓  browser  test/sdk/product/usePageProductsQuery.browser.test.ts (9 tests) 50ms
24
+ ✓  browser  test/components/CartRecommendationShelf/CartRecommendationShelf.browser.test.tsx (13 tests) 75ms
25
+ ✓  browser  test/sdk/localization/useBindingSelector.browser.test.tsx (9 tests) 27ms
26
+ ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (6 tests) 12ms
27
+ ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 48ms
28
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (12 tests) 75ms
36
29
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
37
30
  Error in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
38
31
   at node:internal/deps/undici/undici:16416:13
@@ -62,11 +55,20 @@ Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
62
55
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
63
56
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
64
57
 
65
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 80ms
66
- ✓  browser  test/sdk/product/useProductQuery.browser.test.ts (5 tests) 350ms
67
- ✓  browser  test/components/CartSidebar/CartSidebar.browser.test.tsx (5 tests) 153ms
68
- ✓  browser  test/components/sections/Account/AccountOrderDetails.browser.test.tsx (4 tests) 123ms
69
- ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (7 tests) 26ms
58
+ ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 89ms
59
+ ✓  browser  test/sdk/product/useProductQuery.browser.test.ts (5 tests) 311ms
60
+ ✓  browser  test/components/CartSidebar/CartSidebar.browser.test.tsx (5 tests) 43ms
61
+ ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (7 tests) 14ms
62
+ ✓  browser  test/components/sections/Account/AccountOrderDetails.browser.test.tsx (4 tests) 54ms
63
+ stderr | test/sdk/session/validateSession.browser.test.ts
64
+ Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
65
+ at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
66
+ at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:124:9)
67
+ at onValidate (/home/runner/work/faststore/faststore/packages/core/src/sdk/useStore.ts:18:20)
68
+ at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
69
+  at processTicksAndRejections (node:internal/process/task_queues:103:5)
70
+
71
+ ✓  browser  test/sdk/session/validateSession.browser.test.ts (9 tests) 20ms
70
72
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
71
73
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
72
74
 
@@ -104,14 +106,6 @@ act(() => {
104
106
  This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
105
107
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
106
108
 
107
- stderr | test/sdk/session/validateSession.browser.test.ts
108
- Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
109
- at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
110
- at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:124:9)
111
- at onValidate (/home/runner/work/faststore/faststore/packages/core/src/sdk/useStore.ts:18:20)
112
- at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
113
-  at processTicksAndRejections (node:internal/process/task_queues:103:5)
114
-
115
109
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > defaults returnTo to root and shows API validation errors
116
110
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
117
111
 
@@ -208,7 +202,6 @@ act(() => {
208
202
  This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
209
203
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
210
204
 
211
- ✓  browser  test/sdk/session/validateSession.browser.test.ts (9 tests) 26ms
212
205
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > shows service unavailable when the response is not a login payload
213
206
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
214
207
 
@@ -257,7 +250,6 @@ act(() => {
257
250
  This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
258
251
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
259
252
 
260
- ✓  browser  test/components/navigation/Navbar.browser.test.tsx (3 tests) 115ms
261
253
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > shows service unavailable when the login request fails
262
254
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
263
255
 
@@ -306,7 +298,10 @@ act(() => {
306
298
  This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
307
299
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
308
300
 
309
- ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 917ms
301
+ ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 649ms
302
+ ✓  browser  test/components/navigation/Navbar.browser.test.tsx (3 tests) 89ms
303
+ ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (8 tests) 433ms
304
+ ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (5 tests) 68ms
310
305
  stderr | test/components/cms/RenderSections.browser.test.tsx
311
306
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
312
307
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -315,12 +310,9 @@ This ensures that you're testing the behavior the user would see in the browser.
315
310
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
316
311
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
317
312
 
318
- ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (5 tests) 112ms
319
- ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (8 tests) 667ms
320
- ✓ shows manage link for organization managers  438ms
321
- ✓  browser  test/components/cms/RenderSections.browser.test.tsx (5 tests) 54ms
322
- ✓  browser  test/components/navigation/NavbarSlider.browser.test.tsx (2 tests) 41ms
323
- ✓  browser  test/sdk/product/usePageProductsQuery.deliveryPromise.browser.test.ts (3 tests) 39ms
313
+ ✓  browser  test/components/cms/RenderSections.browser.test.tsx (5 tests) 52ms
314
+ ✓  browser  test/components/navigation/NavbarSlider.browser.test.tsx (2 tests) 21ms
315
+ ✓  browser  test/sdk/product/usePageProductsQuery.deliveryPromise.browser.test.ts (3 tests) 26ms
324
316
  stderr | test/sdk/localization/store-url.browser.test.ts
325
317
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
326
318
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -329,9 +321,10 @@ This ensures that you're testing the behavior the user would see in the browser.
329
321
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
330
322
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
331
323
 
332
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 6ms
333
- ✓  browser  test/components/account/Menu.browser.test.tsx (6 tests) 323ms
334
- ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 42ms
324
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 5ms
325
+ ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 25ms
326
+ ✓  browser  test/components/account/Menu.browser.test.tsx (6 tests) 202ms
327
+ ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 17ms
335
328
  stderr | test/sdk/session/refreshTokenRoute.browser.test.ts
336
329
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
337
330
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -340,13 +333,12 @@ This ensures that you're testing the behavior the user would see in the browser.
340
333
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
341
334
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
342
335
 
343
- ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 40ms
344
- ✓  browser  test/sdk/session/refreshTokenRoute.browser.test.ts (3 tests) 8ms
345
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx (2 tests) 133ms
346
- ✓  browser  test/components/CartRecommendationShelf/CartRecommendationProductCard.browser.test.tsx (3 tests) 69ms
347
- ✓  browser  test/components/navigation/NavbarAccountArea.browser.test.tsx (4 tests) 60ms
348
- ✓  browser  test/components/sections/Account/AccountListQuotes.browser.test.tsx (4 tests) 109ms
349
- ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 19ms
336
+ ✓  browser  test/sdk/session/refreshTokenRoute.browser.test.ts (3 tests) 5ms
337
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx (2 tests) 120ms
338
+ ✓  browser  test/components/sections/Account/AccountListQuotes.browser.test.tsx (4 tests) 87ms
339
+ ✓  browser  test/components/navigation/NavbarAccountArea.browser.test.tsx (4 tests) 35ms
340
+ ✓  browser  test/components/CartRecommendationShelf/CartRecommendationProductCard.browser.test.tsx (3 tests) 26ms
341
+ ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 9ms
350
342
  stderr | test/components/account/doLogout.browser.test.ts
351
343
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
352
344
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -355,12 +347,12 @@ This ensures that you're testing the behavior the user would see in the browser.
355
347
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
356
348
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
357
349
 
358
- ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 48ms
359
- ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (5 tests) 346ms
360
- ✓  browser  test/sdk/product/useProductNotFoundRedirect.browser.test.ts (7 tests) 37ms
361
- ✓  browser  test/sdk/account/useRefreshToken.browser.test.ts (4 tests) 137ms
362
- ✓  browser  test/components/ui/LocalizationButton.browser.test.tsx (3 tests) 44ms
363
- ✓  browser  test/components/account/OrganizationSignInButton.browser.test.tsx (4 tests) 252ms
350
+ ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 28ms
351
+ ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (5 tests) 195ms
352
+ ✓  browser  test/sdk/product/useProductNotFoundRedirect.browser.test.ts (7 tests) 20ms
353
+ ✓  browser  test/sdk/account/useRefreshToken.browser.test.ts (4 tests) 134ms
354
+ ✓  browser  test/components/ui/LocalizationButton.browser.test.tsx (3 tests) 27ms
355
+ ✓  browser  test/components/account/OrganizationSignInButton.browser.test.tsx (4 tests) 140ms
364
356
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
365
357
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
366
358
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -369,13 +361,12 @@ This ensures that you're testing the behavior the user would see in the browser.
369
361
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
370
362
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
371
363
 
372
- ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (4 tests) 43ms
373
- ✓  browser  test/components/sections/Account/AccountOrderDelivery.browser.test.tsx (2 tests) 93ms
374
- ✓  browser  test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx (2 tests) 88ms
375
- ✓  browser  test/components/sections/Account/AccountOrderStatus.browser.test.tsx (3 tests) 113ms
376
- ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 77ms
377
- ✓  browser  test/components/region/useRegion.browser.test.ts (1 test) 25ms
378
- ✓  browser  test/components/sections/Account/AccountOrdersList.browser.test.tsx (2 tests) 26ms
364
+ ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (4 tests) 13ms
365
+ ✓  browser  test/components/sections/Account/AccountOrderDelivery.browser.test.tsx (2 tests) 58ms
366
+ ✓  browser  test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx (2 tests) 61ms
367
+ ✓  browser  test/components/sections/Account/AccountOrderStatus.browser.test.tsx (3 tests) 61ms
368
+ ✓  browser  test/components/region/useRegion.browser.test.ts (1 test) 14ms
369
+ ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 49ms
379
370
  stderr | test/sdk/session/sessionStore.browser.test.ts
380
371
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
381
372
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -384,10 +375,11 @@ This ensures that you're testing the behavior the user would see in the browser.
384
375
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
385
376
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
386
377
 
387
- ✓  browser  test/components/account/orders/SummaryCard.browser.test.tsx (2 tests) 109ms
388
- ✓  browser  test/sdk/session/sessionStore.browser.test.ts (2 tests) 7ms
389
- ✓  browser  test/components/account/orders/DeliveryOptionAccordionDeliveryInfo.browser.test.tsx (1 test) 41ms
390
- ✓  browser  test/utils/shouldBypassRefreshToken.browser.test.ts (5 tests) 4ms
378
+ ✓  browser  test/components/sections/Account/AccountOrdersList.browser.test.tsx (2 tests) 19ms
379
+ ✓  browser  test/sdk/session/sessionStore.browser.test.ts (2 tests) 4ms
380
+ ✓  browser  test/components/account/orders/SummaryCard.browser.test.tsx (2 tests) 40ms
381
+ ✓  browser  test/utils/shouldBypassRefreshToken.browser.test.ts (5 tests) 3ms
382
+ ✓  browser  test/components/account/orders/DeliveryOptionAccordionDeliveryInfo.browser.test.tsx (1 test) 27ms
391
383
  stderr | test/sdk/account/refreshToken.browser.test.ts
392
384
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
393
385
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -396,19 +388,18 @@ This ensures that you're testing the behavior the user would see in the browser.
396
388
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
397
389
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
398
390
 
399
- ✓  browser  test/sdk/account/refreshToken.browser.test.ts (2 tests) 5ms
400
- ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 3ms
401
- ✓  browser  test/components/account/orders/StatusCard.browser.test.tsx (2 tests) 97ms
402
- ✓  browser  test/components/account/orders/DeliveryCard.browser.test.tsx (1 test) 49ms
403
- ✓  browser  test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx (1 test) 41ms
404
- ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 28ms
405
- ✓  node  test/pages/api/switch-contract.test.ts (61 tests) 228ms
406
- ✓  browser  test/components/account/orders/FilterFacetPendingApproval.browser.test.tsx (1 test) 195ms
407
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 19ms
408
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 29ms
409
- ✓  node  test/server/content/service.test.ts (32 tests) 46ms
410
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 9ms
411
- ✓  node  test/utils/match-url.test.ts (10 tests) 10ms
391
+ ✓  browser  test/sdk/account/refreshToken.browser.test.ts (2 tests) 4ms
392
+ ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 2ms
393
+ ✓  browser  test/components/account/orders/StatusCard.browser.test.tsx (2 tests) 70ms
394
+ ✓  browser  test/components/account/orders/DeliveryCard.browser.test.tsx (1 test) 28ms
395
+ ✓  browser  test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx (1 test) 26ms
396
+ ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 23ms
397
+ ✓  node  test/pages/api/switch-contract.test.ts (61 tests) 139ms
398
+ ✓  browser  test/components/account/orders/FilterFacetPendingApproval.browser.test.tsx (1 test) 116ms
399
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 14ms
400
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 22ms
401
+ ✓  node  test/server/content/service.test.ts (32 tests) 30ms
402
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 8ms
412
403
  stderr | test/sdk/deliveryPromise/provider.effect.test.tsx > DeliveryPromiseProvider pickup fetch > clears the loading flag after a failed request and retries on the next update
413
404
  Failed to fetch pickup points: Error: network
414
405
  at /home/runner/work/faststore/faststore/packages/core/test/sdk/deliveryPromise/provider.effect.test.tsx:250:30
@@ -435,6 +426,8 @@ This ensures that you're testing the behavior the user would see in the browser.
435
426
  at trace (file:///home/runner/work/faststore/faststore/node_modules/.pnpm/vitest@4.0.18_@opentelemetry+api@1.9.0_@types+node@20.19.13_jiti@2.6.1_jsdom@27.4.0_sas_13be941c57d55f08f06eeaf1c180ddfe/node_modules/vitest/dist/chunks/test.B8ej_ZHS.js:239:21)
436
427
  at runTest (file:///home/runner/work/faststore/faststore/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:1653:12)
437
428
 
429
+ ✓  node  test/sdk/deliveryPromise/provider.effect.test.tsx (9 tests) 50ms
430
+ ✓  node  test/utils/match-url.test.ts (10 tests) 5ms
438
431
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
439
432
  Graphql execution returned with error: [
440
433
  {
@@ -447,7 +440,6 @@ This ensures that you're testing the behavior the user would see in the browser.
447
440
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates UnauthorizedError status
448
441
  Graphql execution returned with error: [ { message: 'nope', status: 401, type: 'UnauthorizedError' } ]
449
442
 
450
- ✓  node  test/sdk/deliveryPromise/provider.effect.test.tsx (9 tests) 90ms
451
443
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates ForbiddenError status
452
444
  Graphql execution returned with error: [ { message: 'nope', status: 403, type: 'ForbiddenError' } ]
453
445
 
@@ -577,13 +569,13 @@ This ensures that you're testing the behavior the user would see in the browser.
577
569
  extensions: { status: 401, type: 'UnauthorizedError' }
578
570
  }
579
571
 
580
- ✓  node  test/pages/api/graphql.test.ts (30 tests) 46ms
581
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 125ms
582
- ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (14 tests) 9ms
583
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 9ms
572
+ ✓  node  test/pages/api/graphql.test.ts (30 tests) 25ms
573
+ ✓  node  test/pages/api/unlock.test.ts (15 tests) 83ms
574
+ ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (14 tests) 10ms
584
575
  stderr | test/components/search/SearchInputComponent.test.tsx
585
576
  Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
586
577
 
578
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 5ms
587
579
  stderr | test/components/search/SearchInputComponent.test.tsx > SearchInput (OES integration) > renders without crashing
588
580
  Warning: React does not recognize the `visibleDropdown` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `visibledropdown` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
589
581
  at div
@@ -644,63 +636,64 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
644
636
  at Suspense
645
637
  at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
646
638
 
647
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 79ms
648
- ✓  node  test/sdk/account/refreshToken.test.ts (21 tests) 13ms
649
- ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (15 tests) 377ms
650
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 37ms
639
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 58ms
640
+ ✓  node  test/sdk/account/refreshToken.test.ts (21 tests) 6ms
641
+ ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (15 tests) 269ms
642
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 34ms
651
643
  stderr | test/pages/pvt/account/cards/index.test.ts > Cards page getServerSideProps > redirects to /pvt/account/403 when the query fails with 401/403
652
644
  { extensions: { status: 401 } }
653
645
 
654
646
  stderr | test/pages/pvt/account/cards/index.test.ts > Cards page getServerSideProps > renders the error state (no redirect) when the query fails with a non-auth status
655
647
  { extensions: { status: 502 } }
656
648
 
657
- ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 7ms
658
- ✓  node  test/components/quotes/quoteFilters.test.ts (26 tests) 27ms
659
- ✓  node  test/utils/productJsonLd.test.ts (36 tests) 12ms
660
- ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (11 tests) 813ms
661
- ✓ navigates with the search term on blur  360ms
662
- ✓ navigates without a label param when the search is cleared  360ms
663
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 14ms
664
- ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 10ms
665
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 30ms
666
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 5ms
649
+ ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 6ms
650
+ ✓  node  test/components/quotes/quoteFilters.test.ts (26 tests) 16ms
651
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 6ms
652
+ ✓  node  test/utils/productJsonLd.test.ts (36 tests) 5ms
653
+ ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 4ms
654
+ ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (11 tests) 788ms
655
+ ✓ navigates with the search term on blur  355ms
656
+ ✓ navigates without a label param when the search is cleared  356ms
657
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 16ms
658
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 4ms
667
659
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
668
660
  Set password request failed: Bad Request
669
661
 
670
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 37ms
671
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 35ms
672
- ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 6ms
673
- ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (8 tests) 130ms
674
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (14 tests) 161ms
675
- ✓  node  test/utils/localization/hreflang.test.ts (8 tests) 7ms
676
- ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (10 tests) 109ms
677
- ✓  node  test/server/cms/index.test.ts (7 tests) 11ms
678
- ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (13 tests) 10ms
679
- ✓  node  test/server/content/promiseCache.test.ts (10 tests) 18ms
680
- ✓  node  test/sdk/redirects/index.test.ts (7 tests) 32ms
681
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 52ms
682
- ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 46ms
683
- ✓  node  test/proxy.localization.test.ts (5 tests) 47ms
684
- ✓  node  test/utils/trustedForwardedHost.test.ts (36 tests) 11ms
685
- ✓  node  test/components/account/orders/getDeliveryOptionLabel.test.ts (21 tests) 8ms
686
- ✓  node  test/sdk/graphql/retryPolicy.test.ts (18 tests) 22ms
687
- ✓  node  test/server/cms/myAccountDefaultSections.test.ts (9 tests) 5ms
688
- ✓  node  test/utils/productJsonLdRendering.test.tsx (5 tests) 10ms
689
- ✓  node  test/server/index.test.ts (7 tests) 1067ms
690
- ✓ should handle options and execute  613ms
691
- ✓  node  test/proxy.test.ts (4 tests) 25ms
692
- ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 51ms
693
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 35ms
694
- ✓  node  test/pages/api/logout.test.ts (4 tests) 27ms
695
- ✓  node  test/utils/shouldBypassRefreshToken.test.ts (14 tests) 7ms
696
- ✓  node  test/server/webops-api.test.ts (9 tests) 11ms
697
- ✓  node  test/components/account/orders/StatusCard.test.ts (3 tests) 27ms
698
- ✓  node  test/sdk/deliveryPromise/queries.test.ts (4 tests) 10ms
699
- ✓  node  test/sdk/localization/store-url.test.ts (4 tests) 6ms
700
- ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 12ms
701
- ✓  node  test/server/cms/global.test.ts (3 tests) 5ms
702
- ✓  node  test/sdk/deliveryPromise/provider.test.ts (11 tests) 6ms
703
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 30ms
662
+ ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 27ms
663
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 24ms
664
+ ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 4ms
665
+ ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (8 tests) 90ms
666
+ ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (14 tests) 82ms
667
+ ✓  node  test/utils/localization/hreflang.test.ts (8 tests) 6ms
668
+ ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (13 tests) 6ms
669
+ ✓  node  test/server/cms/index.test.ts (7 tests) 5ms
670
+ ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (10 tests) 60ms
671
+ ✓  node  test/server/content/promiseCache.test.ts (10 tests) 7ms
672
+ ✓  node  test/sdk/redirects/index.test.ts (7 tests) 23ms
673
+ ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 32ms
674
+ ✓  node  test/utils/toRevalidate.test.ts (16 tests) 30ms
675
+ ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 30ms
676
+ ✓  node  test/utils/trustedForwardedHost.test.ts (36 tests) 6ms
677
+ ✓  node  test/proxy.localization.test.ts (5 tests) 58ms
678
+ ✓  node  test/components/account/orders/getDeliveryOptionLabel.test.ts (21 tests) 5ms
679
+ ✓  node  test/sdk/graphql/retryPolicy.test.ts (18 tests) 9ms
680
+ ✓  node  test/server/cms/myAccountDefaultSections.test.ts (9 tests) 3ms
681
+ ✓  node  test/utils/productJsonLdRendering.test.tsx (5 tests) 7ms
682
+ ✓  node  test/server/index.test.ts (7 tests) 761ms
683
+ ✓ should handle options and execute  463ms
684
+ ✓  node  test/proxy.test.ts (4 tests) 15ms
685
+ ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 32ms
686
+ ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 22ms
687
+ ✓  node  test/pages/api/logout.test.ts (4 tests) 21ms
688
+ ✓  node  test/utils/shouldBypassRefreshToken.test.ts (14 tests) 4ms
689
+ ✓  node  test/server/webops-api.test.ts (9 tests) 7ms
690
+ ✓  node  test/components/account/orders/StatusCard.test.ts (3 tests) 17ms
691
+ ✓  node  test/sdk/localization/store-url.test.ts (4 tests) 3ms
692
+ ✓  node  test/sdk/deliveryPromise/queries.test.ts (4 tests) 5ms
693
+ ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 7ms
694
+ ✓  node  test/server/cms/global.test.ts (3 tests) 2ms
695
+ ✓  node  test/sdk/deliveryPromise/provider.test.ts (11 tests) 3ms
696
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 20ms
704
697
  stderr | test/server/storeDirectives.test.ts > store directives through the core server > applies @auth from a store field and validates the session once
705
698
  https://storeframework.vtexcommercestable.com.br/api/vtexid/credential/validate {
706
699
  headers: { 'content-type': 'application/json', 'X-FORWARDED-HOST': '' },
@@ -708,43 +701,43 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
708
701
  method: 'POST'
709
702
  } { status: 401, statusText: 'Unauthorized', headers: {} }
710
703
 
711
- ✓  node  test/server/storeDirectives.test.ts (2 tests) 102ms
712
- ✓  node  test/utils/mergeDiscoveryConfig.test.ts (8 tests) 10ms
713
- ✓  node  test/server/rootSpan.test.ts (4 tests) 29ms
714
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 6ms
715
- ✓  node  test/pages/api/preview.test.ts (2 tests) 9ms
716
- ✓  node  test/components/account/Layout.test.tsx (6 tests) 57ms
704
+ ✓  node  test/server/storeDirectives.test.ts (2 tests) 78ms
705
+ ✓  node  test/utils/mergeDiscoveryConfig.test.ts (8 tests) 7ms
706
+ ✓  node  test/server/rootSpan.test.ts (4 tests) 22ms
707
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 3ms
708
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 4ms
709
+ ✓  node  test/components/account/Layout.test.tsx (6 tests) 45ms
717
710
  ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
718
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
719
- ✓  node  test/pages/pvt/account/403.test.ts (5 tests) 8ms
720
- ✓  node  test/components/region/useRegion.test.ts (1 test) 23ms
721
- ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 5ms
711
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 3ms
712
+ ✓  node  test/pages/pvt/account/403.test.ts (5 tests) 5ms
713
+ ✓  node  test/components/region/useRegion.test.ts (1 test) 18ms
714
+ ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 3ms
722
715
  ✓  node  test/utils/retry.test.ts (5 tests) 12ms
723
- ✓  node  test/sdk/account/getIsB2BBuyer.test.ts (7 tests) 6ms
724
- ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 4ms
725
- ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 191ms
726
- ✓  node  test/utils/subDomainPrefixWarning.test.ts (6 tests) 4ms
727
- ✓  node  test/utils/userOrderStatus.test.ts (4 tests) 4ms
728
- ✓  node  test/utils/unlockResponse.test.ts (11 tests) 6ms
729
- ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 10ms
730
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 51ms
731
- ✓  node  test/sdk/deliveryPromise/reducer.test.ts (2 tests) 4ms
732
- ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (4 tests) 31ms
716
+ ✓  node  test/sdk/account/getIsB2BBuyer.test.ts (7 tests) 3ms
717
+ ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 2ms
718
+ ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 173ms
719
+ ✓  node  test/utils/subDomainPrefixWarning.test.ts (6 tests) 2ms
720
+ ✓  node  test/utils/userOrderStatus.test.ts (4 tests) 3ms
721
+ ✓  node  test/utils/unlockResponse.test.ts (11 tests) 3ms
722
+ ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 2ms
723
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 30ms
724
+ ✓  node  test/sdk/deliveryPromise/reducer.test.ts (2 tests) 3ms
725
+ ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (4 tests) 26ms
733
726
  ✓  node  test/utils/isLocalHost.test.ts (7 tests) 3ms
734
- ✓  node  test/sdk/session/toSessionInput.test.ts (3 tests) 5ms
735
- ✓  node  test/components/account/orders/getOrderTotalLabel.test.ts (6 tests) 4ms
736
- ✓  node  test/components/account/orders/listOrdersLabels.test.ts (2 tests) 4ms
737
- ✓  node  test/utils/getCookie.test.ts (4 tests) 8ms
738
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 30ms
739
- ✓  node  test/sdk/session/isSignInAreaResolved.test.ts (3 tests) 4ms
727
+ ✓  node  test/sdk/session/toSessionInput.test.ts (3 tests) 4ms
728
+ ✓  node  test/components/account/orders/getOrderTotalLabel.test.ts (6 tests) 3ms
729
+ ✓  node  test/components/account/orders/listOrdersLabels.test.ts (2 tests) 2ms
730
+ ✓  node  test/utils/getCookie.test.ts (4 tests) 3ms
731
+ ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 23ms
732
+ ✓  node  test/sdk/session/isSignInAreaResolved.test.ts (3 tests) 2ms
740
733
  ✓  node  test/utils/filterChannel.test.ts (2 tests) 3ms
741
- ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 3ms
742
- ✓  node  test/instrumentation.test.ts (3 tests) 4ms
743
- ✓  node  test/components/account/orders/orderDetailsLabels.test.ts (1 test) 3ms
744
- ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 11ms
745
-
746
-  Test Files  149 passed (149)
747
-  Tests  1270 passed (1270)
748
-  Start at  19:14:03
749
-  Duration  63.31s (transform 14.86s, setup 0ms, import 55.56s, tests 22.91s, environment 77.73s)
734
+ ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 2ms
735
+ ✓  node  test/instrumentation.test.ts (3 tests) 3ms
736
+ ✓  node  test/components/account/orders/orderDetailsLabels.test.ts (1 test) 2ms
737
+ ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 6ms
738
+
739
+  Test Files  150 passed (150)
740
+  Tests  1286 passed (1286)
741
+  Start at  15:25:42
742
+  Duration  43.72s (transform 11.41s, setup 0ms, import 40.25s, tests 15.33s, environment 51.80s)
750
743
 
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.11.4-dev.3](https://github.com/vtex/faststore/compare/v4.11.4-dev.2...v4.11.4-dev.3) (2026-11-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **core:** add experimental.revalidatePLP to refresh cached PLPs ([#3595](https://github.com/vtex/faststore/issues/3595)) ([f14ca23](https://github.com/vtex/faststore/commit/f14ca23c3581d94961eac3bdc6839207066eff74)), closes [#3553](https://github.com/vtex/faststore/issues/3553) [#3553](https://github.com/vtex/faststore/issues/3553)
11
+
6
12
  ## [4.11.4-dev.2](https://github.com/vtex/faststore/compare/v4.11.4-dev.1...v4.11.4-dev.2) (2026-11-17)
7
13
 
8
14
  **Note:** Version bump only for package @faststore/core
@@ -196,6 +196,11 @@ module.exports = {
196
196
  enableRedirects: false,
197
197
  // ISR window (seconds) for notFound PDP/PLP paths.
198
198
  revalidate404: 60 * 5, // 5 minutes
199
+ // ISR window (seconds) for PLPs served by `[...slug]`. `false` (default)
200
+ // caches the page until the next deploy. Set a positive integer number of
201
+ // seconds (values below 60 are raised to 60) to refresh the
202
+ // server-rendered first page (price, stock, order).
203
+ revalidatePLP: false,
199
204
  enableSearchSSR: false,
200
205
  enableFaststoreMyAccount: false,
201
206
  useIsGiftFromOrderForm: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "4.11.4-dev.2",
3
+ "version": "4.11.4-dev.3",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,11 +70,11 @@
70
70
  "style-loader": "^3.3.1",
71
71
  "swr": "^2.2.5",
72
72
  "use-sync-external-store": "^1.6.0",
73
- "@faststore/diagnostics": "4.11.4-dev.2",
74
- "@faststore/sdk": "4.11.4-dev.2",
75
- "@faststore/api": "4.11.4-dev.2",
76
- "@faststore/lighthouse": "4.11.4-dev.2",
77
- "@faststore/ui": "4.11.4-dev.2"
73
+ "@faststore/api": "4.11.4-dev.3",
74
+ "@faststore/sdk": "4.11.4-dev.3",
75
+ "@faststore/ui": "4.11.4-dev.3",
76
+ "@faststore/diagnostics": "4.11.4-dev.3",
77
+ "@faststore/lighthouse": "4.11.4-dev.3"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@cypress/code-coverage": "^3.12.1",
@@ -32,6 +32,7 @@ import { contentService } from 'src/server/content/service'
32
32
  import type { PreviewData } from 'src/server/content/types'
33
33
  import { getDynamicContent } from 'src/utils/dynamicContent'
34
34
  import { fetchServerManyProducts } from 'src/utils/fetchProductGallerySSR'
35
+ import { toRevalidate } from 'src/utils/toRevalidate'
35
36
 
36
37
  const LandingPage = dynamic(
37
38
  () => import('src/components/templates/LandingPage')
@@ -244,6 +245,15 @@ export const getStaticProps: GetStaticProps<
244
245
  type: 'plp',
245
246
  key: slug,
246
247
  },
248
+ // Without a window, the first page's products (price, stock, order) stay
249
+ // frozen at the state of their first render until the next deploy. Each
250
+ // regeneration reruns the CMS, collection and first-page search queries,
251
+ // so the window has a floor to bound the upstream load.
252
+ revalidate: toRevalidate(
253
+ storeConfig.experimental.revalidatePLP,
254
+ 'experimental.revalidatePLP',
255
+ { min: 60 }
256
+ ),
247
257
  }
248
258
  }
249
259
 
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Config keys already warned about in this process. `getStaticProps` runs on
3
+ * every regeneration, so a per-call warning would repeat for every hot page.
4
+ */
5
+ const warnedKeys = new Set<string>()
6
+
7
+ function warnOnce(key: string, message: string) {
8
+ if (warnedKeys.has(key)) {
9
+ return
10
+ }
11
+
12
+ warnedKeys.add(key)
13
+ console.warn(message)
14
+ }
15
+
16
+ /**
17
+ * Normalizes an ISR `revalidate` window read from the store config.
18
+ *
19
+ * Returns the value when it is a positive integer number of seconds, raised
20
+ * to `min` when it is lower. Any other value returns `false`, which keeps
21
+ * Next.js' default for static pages: the page is cached until the next
22
+ * deploy. Next.js rejects `0`, negative and fractional windows at render
23
+ * time, so those fall back to `false` with a warning instead of breaking the
24
+ * page.
25
+ *
26
+ * @param value The configured window, e.g. `experimental.revalidatePLP`.
27
+ * @param key The config key, used in the warnings.
28
+ * @param options.min The shortest window allowed, in seconds. Defaults to 1.
29
+ */
30
+ export function toRevalidate(
31
+ value: unknown,
32
+ key: string,
33
+ { min = 1 }: { min?: number } = {}
34
+ ): number | false {
35
+ if (typeof value === 'number' && Number.isInteger(value) && value > 0) {
36
+ if (value < min) {
37
+ warnOnce(
38
+ key,
39
+ `[FastStore] ${key} is ${value}s. Using the minimum of ${min}s.`
40
+ )
41
+
42
+ return min
43
+ }
44
+
45
+ return value
46
+ }
47
+
48
+ if (value !== false && value !== undefined && value !== null) {
49
+ warnOnce(
50
+ key,
51
+ `[FastStore] Invalid ${key}: ${describeValue(value)}. Expected a positive integer number of seconds or false. The page will be cached until the next deploy.`
52
+ )
53
+ }
54
+
55
+ return false
56
+ }
57
+
58
+ /**
59
+ * Describes a config value for a warning without ever throwing: objects can
60
+ * be circular or hold bigints, which JSON.stringify rejects, so only their
61
+ * type is printed.
62
+ */
63
+ function describeValue(value: unknown): string {
64
+ switch (typeof value) {
65
+ case 'number':
66
+ case 'bigint':
67
+ case 'boolean':
68
+ return `${value}`
69
+ case 'string':
70
+ return JSON.stringify(value)
71
+ default:
72
+ return `a value of type ${typeof value}`
73
+ }
74
+ }
@@ -0,0 +1,118 @@
1
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
2
+
3
+ import type { toRevalidate as ToRevalidate } from 'src/utils/toRevalidate'
4
+
5
+ const KEY = 'experimental.revalidatePLP'
6
+
7
+ // The helper warns once per key per process, so each test loads a fresh
8
+ // module to start with no warnings recorded.
9
+ let toRevalidate: typeof ToRevalidate
10
+
11
+ beforeEach(async () => {
12
+ vi.resetModules()
13
+ ;({ toRevalidate } = await import('src/utils/toRevalidate'))
14
+ })
15
+
16
+ afterEach(() => {
17
+ vi.restoreAllMocks()
18
+ })
19
+
20
+ describe('toRevalidate', () => {
21
+ it('returns the number of seconds when it is a positive integer', () => {
22
+ expect(toRevalidate(300, KEY)).toBe(300)
23
+ expect(toRevalidate(1, KEY)).toBe(1)
24
+ })
25
+
26
+ it('returns false without a warning when the window is disabled or unset', () => {
27
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
28
+
29
+ expect(toRevalidate(false, KEY)).toBe(false)
30
+ expect(toRevalidate(undefined, KEY)).toBe(false)
31
+ expect(toRevalidate(null, KEY)).toBe(false)
32
+ expect(warn).not.toHaveBeenCalled()
33
+ })
34
+
35
+ it.each([
36
+ // Next.js throws for these.
37
+ 0,
38
+ -60,
39
+ 90.5,
40
+ 0.5,
41
+ Number.NaN,
42
+ Number.POSITIVE_INFINITY,
43
+ '300',
44
+ // Next.js reads `true` as 1 second; the config expects explicit seconds.
45
+ true,
46
+ ])('returns false and warns for %s', (value) => {
47
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
48
+
49
+ expect(toRevalidate(value, KEY)).toBe(false)
50
+ expect(warn).toHaveBeenCalledWith(expect.stringContaining(KEY))
51
+ })
52
+
53
+ it('prints the received value in the warning', () => {
54
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
55
+
56
+ toRevalidate('300', 'a')
57
+ toRevalidate(Number.NaN, 'b')
58
+ toRevalidate({ seconds: 300 }, 'c')
59
+
60
+ expect(warn).toHaveBeenNthCalledWith(1, expect.stringContaining('"300"'))
61
+ expect(warn).toHaveBeenNthCalledWith(2, expect.stringContaining(': NaN.'))
62
+ expect(warn).toHaveBeenNthCalledWith(
63
+ 3,
64
+ expect.stringContaining('a value of type object')
65
+ )
66
+ })
67
+
68
+ it('does not throw for values JSON.stringify rejects', () => {
69
+ vi.spyOn(console, 'warn').mockImplementation(() => {})
70
+
71
+ const circular: Record<string, unknown> = {}
72
+ circular.self = circular
73
+
74
+ expect(toRevalidate(circular, 'a')).toBe(false)
75
+ expect(toRevalidate({ seconds: BigInt(300) }, 'b')).toBe(false)
76
+ expect(toRevalidate(BigInt(300), 'c')).toBe(false)
77
+ })
78
+
79
+ it('warns about an invalid value once per key', () => {
80
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
81
+
82
+ toRevalidate('300', KEY)
83
+ toRevalidate('300', KEY)
84
+
85
+ expect(warn).toHaveBeenCalledTimes(1)
86
+ })
87
+
88
+ describe('with a minimum', () => {
89
+ it('raises a lower window to the minimum and warns once', () => {
90
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
91
+
92
+ expect(toRevalidate(30, KEY, { min: 60 })).toBe(60)
93
+ expect(toRevalidate(30, KEY, { min: 60 })).toBe(60)
94
+ expect(toRevalidate(1, KEY, { min: 60 })).toBe(60)
95
+ expect(warn).toHaveBeenCalledTimes(1)
96
+ expect(warn).toHaveBeenCalledWith(
97
+ `[FastStore] ${KEY} is 30s. Using the minimum of 60s.`
98
+ )
99
+ })
100
+
101
+ it('keeps windows at or above the minimum', () => {
102
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
103
+
104
+ expect(toRevalidate(60, KEY, { min: 60 })).toBe(60)
105
+ expect(toRevalidate(120, KEY, { min: 60 })).toBe(120)
106
+ expect(warn).not.toHaveBeenCalled()
107
+ })
108
+
109
+ it('still returns false for invalid values', () => {
110
+ vi.spyOn(console, 'warn').mockImplementation(() => {})
111
+
112
+ expect(toRevalidate(0, KEY, { min: 60 })).toBe(false)
113
+ expect(toRevalidate(30.5, 'a', { min: 60 })).toBe(false)
114
+ expect(toRevalidate('30', 'b', { min: 60 })).toBe(false)
115
+ expect(toRevalidate(false, 'c', { min: 60 })).toBe(false)
116
+ })
117
+ })
118
+ })