@faststore/core 4.7.0-dev.3 → 4.7.0-dev.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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @faststore/core@4.7.0-dev.2 generate /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.7.0-dev.3 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.7.0-dev.2 gen-types /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@4.7.0-dev.3 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 /home/runner/work/faststore/faststore/packages/core/@generated/
20
20
  [COMPLETED] Generate outputs
21
21
 
22
- > @faststore/core@4.7.0-dev.2 cache-graphql /home/runner/work/faststore/faststore/packages/core
22
+ > @faststore/core@4.7.0-dev.3 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,26 +1,25 @@
1
1
 
2
- > @faststore/core@4.7.0-dev.2 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.7.0-dev.3 test /home/runner/work/faststore/faststore/packages/core
3
3
  > vitest run
4
4
 
5
5
 
6
6
   RUN  v4.0.18 /home/runner/work/faststore/faststore/packages/core
7
7
 
8
- Not implemented: navigation to another Document
9
- Not implemented: navigation to another Document
10
- ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 1015ms
11
8
  Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
12
9
  npx update-browserslist-db@latest
13
10
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
14
- ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (14 tests) 2045ms
15
- ✓ shows the tab bar and renders Personal cards by default  821ms
16
- ✓ paginates when there are more than 25 cards  327ms
17
- ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 216ms
18
- ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 2517ms
19
- ✓ shows an error state when the list fails to load  773ms
20
- ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  391ms
21
- ✓ keeps Confirm disabled until a different contract is selected  338ms
22
- ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 33ms
23
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (10 tests) 124ms
11
+ Not implemented: navigation to another Document
12
+ Not implemented: navigation to another Document
13
+ ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 3129ms
14
+ ✓ shows an error state when the list fails to load  876ms
15
+ ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  533ms
16
+ ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 1002ms
17
+ ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (14 tests) 2391ms
18
+ ✓ shows the tab bar and renders Personal cards by default  1007ms
19
+ ✓ paginates when there are more than 25 cards  358ms
20
+ ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 30ms
21
+ ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 162ms
22
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (12 tests) 128ms
24
23
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
25
24
  Error in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
26
25
   at node:internal/deps/undici/undici:16416:13
@@ -50,8 +49,7 @@ Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
50
49
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
51
50
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
52
51
 
53
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 115ms
54
- ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 22ms
52
+ ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (7 tests) 255ms
55
53
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
56
54
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
57
55
 
@@ -185,8 +183,6 @@ act(() => {
185
183
  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
186
184
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
187
185
 
188
- ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1169ms
189
- ✓ renders the menu view with contract details and manage footer  632ms
190
186
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > shows service unavailable when the response is not a login payload
191
187
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
192
188
 
@@ -283,9 +279,13 @@ act(() => {
283
279
  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
284
280
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
285
281
 
286
- ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1239ms
287
- ✓ renders the password protection form  640ms
288
- ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 28ms
282
+ ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1530ms
283
+ ✓ renders the password protection form  544ms
284
+ ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1630ms
285
+ ✓ renders the menu view with contract details and manage footer  917ms
286
+ ✓ opens the contract switcher and returns to the menu on back  372ms
287
+ ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 38ms
288
+ ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 56ms
289
289
  stderr | test/sdk/localization/store-url.browser.test.ts
290
290
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
291
291
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -295,9 +295,10 @@ This ensures that you're testing the behavior the user would see in the browser.
295
295
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
296
296
 
297
297
  ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 5ms
298
- ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 36ms
299
- ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 39ms
300
- ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 27ms
298
+ ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 41ms
299
+ ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 30ms
300
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx (2 tests) 132ms
301
+ ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 39ms
301
302
  stderr | test/components/account/doLogout.browser.test.ts
302
303
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
303
304
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -306,10 +307,10 @@ This ensures that you're testing the behavior the user would see in the browser.
306
307
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
307
308
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
308
309
 
309
- ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 31ms
310
- ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 82ms
311
- ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 273ms
312
- ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 281ms
310
+ ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 22ms
311
+ ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 98ms
312
+ ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 301ms
313
+ ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 275ms
313
314
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
314
315
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
315
316
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -318,12 +319,11 @@ This ensures that you're testing the behavior the user would see in the browser.
318
319
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
319
320
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
320
321
 
321
- ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 8ms
322
322
  ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 5ms
323
+ ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 8ms
323
324
  ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 3ms
324
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 25ms
325
- ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 40ms
326
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 43ms
325
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 19ms
326
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 34ms
327
327
  stderr | test/sdk/account/refreshToken.browser.test.ts
328
328
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
329
329
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -332,11 +332,12 @@ This ensures that you're testing the behavior the user would see in the browser.
332
332
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
333
333
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
334
334
 
335
- ✓  node  test/utils/match-url.test.ts (10 tests) 8ms
336
- ✓  browser  test/sdk/account/refreshToken.browser.test.ts (1 test) 5ms
337
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 15ms
338
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 154ms
339
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 8ms
335
+ ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 38ms
336
+ ✓  browser  test/sdk/account/refreshToken.browser.test.ts (1 test) 3ms
337
+ ✓  node  test/utils/match-url.test.ts (10 tests) 9ms
338
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 14ms
339
+ ✓  node  test/pages/api/unlock.test.ts (15 tests) 151ms
340
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 7ms
340
341
  stderr | test/components/search/SearchInputComponent.test.tsx
341
342
  Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
342
343
 
@@ -400,8 +401,8 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
400
401
  at Suspense
401
402
  at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
402
403
 
403
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 73ms
404
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 54ms
404
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 74ms
405
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 59ms
405
406
  ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 12ms
406
407
  stderr | test/pages/pvt/account/cards/index.test.ts > Cards page getServerSideProps > redirects to /pvt/account/403 when the query fails with 401/403
407
408
  { extensions: { status: 401 } }
@@ -409,10 +410,10 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
409
410
  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
410
411
  { extensions: { status: 502 } }
411
412
 
412
- ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 11ms
413
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 27ms
414
- ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 10ms
415
- ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 390ms
413
+ ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 10ms
414
+ ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 7ms
415
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 30ms
416
+ ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 380ms
416
417
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
417
418
  Graphql execution returned with error: [
418
419
  {
@@ -505,65 +506,63 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
505
506
  at file:///home/runner/work/faststore/faststore/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:1653:37
506
507
  at Traces.$ (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/traces.CCmnQaNT.js:142:27)
507
508
 
508
- ✓  node  test/pages/api/graphql.test.ts (17 tests) 22ms
509
- ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 840ms
510
- ✓ navigates with the search term on blur  360ms
511
- ✓ navigates without a label param when the search is cleared  361ms
509
+ ✓  node  test/pages/api/graphql.test.ts (17 tests) 29ms
512
510
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
513
511
  Set password request failed: Bad Request
514
512
 
515
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 44ms
516
- ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 37ms
517
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 38ms
513
+ ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 28ms
514
+ ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 806ms
515
+ ✓ navigates with the search term on blur  360ms
516
+ ✓ navigates without a label param when the search is cleared  359ms
517
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 30ms
518
518
  ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 5ms
519
- ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 7ms
519
+ ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 25ms
520
+ ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 5ms
520
521
  ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (12 tests) 9ms
521
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 48ms
522
- ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 129ms
523
- ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 47ms
524
- ✓  node  test/proxy.localization.test.ts (5 tests) 26ms
525
- ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 25ms
526
- ✓  node  test/server/index.test.ts (7 tests) 1128ms
527
- ✓ should handle options and execute  605ms
528
- ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (6 tests) 10ms
529
- ✓  node  test/proxy.test.ts (4 tests) 18ms
530
- ✓  node  test/server/webops-api.test.ts (9 tests) 28ms
531
- ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 91ms
532
- ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 12ms
533
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 41ms
534
- ✓  node  test/server/content/service.test.ts (5 tests) 5ms
522
+ ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 56ms
523
+ ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 136ms
524
+ ✓  node  test/proxy.localization.test.ts (5 tests) 37ms
525
+ ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 30ms
526
+ ✓  node  test/server/index.test.ts (7 tests) 820ms
527
+ ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (6 tests) 9ms
528
+ ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 117ms
529
+ ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 57ms
530
+ ✓  node  test/proxy.test.ts (4 tests) 19ms
531
+ ✓  node  test/server/webops-api.test.ts (9 tests) 13ms
532
+ ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 11ms
533
+ ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 35ms
535
534
  ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 7ms
535
+ ✓  node  test/server/content/service.test.ts (5 tests) 5ms
536
536
  ✓  node  test/server/cms/global.test.ts (3 tests) 6ms
537
- ✓  node  test/sdk/localization/store-url.test.ts (1 test) 4ms
538
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 20ms
539
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 129ms
540
- ✓  node  test/sdk/analytics/hasEnabledRecommendationShelf.test.ts (6 tests) 5ms
541
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 5ms
542
- ✓  node  test/server/rootSpan.test.ts (4 tests) 48ms
543
- ✓  node  test/components/account/Layout.test.tsx (6 tests) 70ms
544
- ✓  node  test/pages/api/preview.test.ts (2 tests) 9ms
545
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
546
- ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
537
+ ✓  node  test/sdk/localization/store-url.test.ts (1 test) 3ms
538
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 22ms
539
+ ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 126ms
540
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 7ms
541
+ ✓  node  test/server/rootSpan.test.ts (4 tests) 39ms
542
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 8ms
543
+ ✓  node  test/components/search/SearchInput.test.ts (6 tests) 9ms
544
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 10ms
545
+ ✓  node  test/components/account/Layout.test.tsx (6 tests) 63ms
547
546
  ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 4ms
548
- ✓  node  test/utils/retry.test.ts (5 tests) 16ms
549
- ✓  node  test/server/cms/index.test.ts (2 tests) 8ms
547
+ ✓  node  test/utils/retry.test.ts (5 tests) 14ms
548
+ ✓  node  test/server/cms/index.test.ts (2 tests) 6ms
550
549
  ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 4ms
551
550
  ✓  node  test/utils/unlockResponse.test.ts (11 tests) 4ms
552
- ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 5ms
553
- ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 189ms
551
+ ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 4ms
552
+ ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 191ms
554
553
  ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 5ms
555
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 41ms
556
- ✓  node  test/utils/isLocalHost.test.ts (7 tests) 5ms
557
- ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 4ms
558
- ✓  node  test/utils/getCookie.test.ts (4 tests) 3ms
554
+ ✓  node  test/utils/isLocalHost.test.ts (7 tests) 4ms
555
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 54ms
556
+ ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 3ms
557
+ ✓  node  test/utils/getCookie.test.ts (4 tests) 5ms
559
558
  ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 4ms
560
- ✓  node  test/instrumentation.test.ts (3 tests) 4ms
561
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 39ms
562
- ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 10ms
563
- ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 23ms
559
+ ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 38ms
560
+ ✓  node  test/instrumentation.test.ts (3 tests) 7ms
561
+ ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 15ms
562
+ ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 24ms
564
563
 
565
564
   Test Files  87 passed (87)
566
-  Tests  698 passed (698)
567
-  Start at  17:40:10
568
-  Duration  39.18s (transform 11.25s, setup 0ms, import 34.85s, tests 13.48s, environment 48.59s)
565
+  Tests  695 passed (695)
566
+  Start at  21:11:21
567
+  Duration  43.29s (transform 10.74s, setup 0ms, import 37.56s, tests 15.12s, environment 54.08s)
569
568
 
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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.7.0-dev.4](https://github.com/vtex/faststore/compare/v4.7.0-dev.3...v4.7.0-dev.4) (2026-08-25)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **core:** address Sonar and session fallback timing ([c0ad09f](https://github.com/vtex/faststore/commit/c0ad09f4903627ce39b233013af40ab2505b5871))
11
+ - **core:** make session enable flag assignment Sonar-clear ([2fdfe96](https://github.com/vtex/faststore/commit/2fdfe96d6dccb22c33fb9f7f250f5531ef6f6f47))
12
+ - **core:** start shelf session fallback in parallel with userId lookup ([6f5afa5](https://github.com/vtex/faststore/commit/6f5afa587a554ab9a4289c01aa6c6eb57e027680))
13
+
14
+ ### Features
15
+
16
+ - **core:** gate recommendation session by feature flag with shelf fallback ([901b345](https://github.com/vtex/faststore/commit/901b3456943de25f028d6443f5f62b9de1db6ad3))
17
+
6
18
  # [4.7.0-dev.3](https://github.com/vtex/faststore/compare/v4.7.0-dev.2...v4.7.0-dev.3) (2026-08-25)
7
19
 
8
20
  **Note:** Version bump only for package @faststore/core
@@ -3,16 +3,10 @@
3
3
  "$componentKey": "RecommendationShelf",
4
4
  "$componentTitle": "Recommendation Shelf",
5
5
  "title": "Recommendation Shelf",
6
- "description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign. Enable the shelf with the Enable recommendations toggle (off by default).",
6
+ "description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign.",
7
7
  "type": "object",
8
8
  "required": ["campaignVrn"],
9
9
  "properties": {
10
- "enableRecommendations": {
11
- "title": "Enable recommendations?",
12
- "description": "When enabled, starts the VTEX Recommendations personalization session (once per browser session) and fetches personalized products for this shelf. Off by default so stores that do not use Recommendations never hit the Recommendations API.",
13
- "type": "boolean",
14
- "default": false
15
- },
16
10
  "title": {
17
11
  "title": "Title",
18
12
  "description": "Override the shelf title. If not set, the campaign title will be used.",
@@ -3872,16 +3872,10 @@
3872
3872
  "$componentKey": "RecommendationShelf",
3873
3873
  "$componentTitle": "Recommendation Shelf",
3874
3874
  "title": "Recommendation Shelf",
3875
- "description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign. Enable the shelf with the Enable recommendations toggle (off by default).",
3875
+ "description": "Display a carousel of personalized product recommendations from a VTEX Recommendations campaign.",
3876
3876
  "type": "object",
3877
3877
  "required": ["campaignVrn"],
3878
3878
  "properties": {
3879
- "enableRecommendations": {
3880
- "title": "Enable recommendations?",
3881
- "description": "When enabled, starts the VTEX Recommendations personalization session (once per browser session) and fetches personalized products for this shelf. Off by default so stores that do not use Recommendations never hit the Recommendations API.",
3882
- "type": "boolean",
3883
- "default": false
3884
- },
3885
3879
  "title": {
3886
3880
  "title": "Title",
3887
3881
  "description": "Override the shelf title. If not set, the campaign title will be used.",
@@ -202,6 +202,11 @@ module.exports = {
202
202
  },
203
203
  refreshToken: false,
204
204
  scrollRestoration: false,
205
+ // Opt-in flag for VTEX Recommendations. When enabled, Layout starts the
206
+ // personalization session on every page. When disabled (default), the
207
+ // session starts only as a RecommendationShelf fallback when userId is
208
+ // missing.
209
+ enableRecommendations: false,
205
210
  /** Package names to transpile (e.g. ['@vtex/components']). Use a non-empty list to enable Next.js transpilation. */
206
211
  transpilePackages: [],
207
212
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "4.7.0-dev.3",
3
+ "version": "4.7.0-dev.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -71,11 +71,11 @@
71
71
  "style-loader": "^3.3.1",
72
72
  "swr": "^2.2.5",
73
73
  "use-sync-external-store": "^1.6.0",
74
- "@faststore/api": "4.7.0-dev.3",
75
- "@faststore/lighthouse": "4.7.0-dev.3",
76
- "@faststore/sdk": "4.7.0-dev.3",
77
- "@faststore/diagnostics": "4.7.0-dev.3",
78
- "@faststore/ui": "4.7.0-dev.3"
74
+ "@faststore/diagnostics": "4.7.0-dev.4",
75
+ "@faststore/lighthouse": "4.7.0-dev.4",
76
+ "@faststore/sdk": "4.7.0-dev.4",
77
+ "@faststore/api": "4.7.0-dev.4",
78
+ "@faststore/ui": "4.7.0-dev.4"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@cypress/code-coverage": "^3.12.1",
package/src/Layout.tsx CHANGED
@@ -7,9 +7,9 @@ function Layout({ children }: PropsWithChildren) {
7
7
  const props = isValidElement(children) ? children.props : undefined
8
8
  usePageViewEvent(props)
9
9
 
10
- // Starts the personalization session once per browser session when the page
11
- // CMS data includes a RecommendationShelf with `enableRecommendations: true`.
12
- useStartRecommendationSession(props)
10
+ // Starts the personalization session once per browser session on every page
11
+ // when `experimental.enableRecommendations` is true.
12
+ useStartRecommendationSession()
13
13
 
14
14
  return <>{children}</>
15
15
  }
@@ -4,7 +4,7 @@ CMS section that renders a carousel of personalized product recommendations from
4
4
 
5
5
  - **Data source:** VTEX Recommendations BFF, exposed by `@faststore/api` through the `recommendations` GraphQL query.
6
6
  - **Registration:** global CMS component (`$componentKey: "RecommendationShelf"`), available on any page via CMS.
7
- - **Opt-in via CMS:** enable Recommendations with the **Enable recommendations?** toggle on the shelf (default `false`). No store code changes or feature flags are required.
7
+ - **Session opt-in:** personalization session starts via the `experimental.enableRecommendations` discovery feature flag (Layout, every page). When the flag is off, any mounted Recommendation Shelf starts the session as a fallback if `userId` is missing.
8
8
 
9
9
  ## Contents
10
10
 
@@ -22,7 +22,7 @@ CMS section that renders a carousel of personalized product recommendations from
22
22
 
23
23
  The shelf renders products only when the following conditions are met:
24
24
 
25
- 1. **Enable recommendations on the shelf.** Set **Enable recommendations?** to `true` on the Recommendation Shelf in the CMS. This opts the store into the personalization session (`startRecommendationSession` mutation, owned by Layout) and allows the shelf to fetch recommendations. Without it (default `false`), no session is started and the shelf does not fetch.
25
+ 1. **Personalization session.** Prefer enabling `experimental.enableRecommendations` in `discovery.config` so `Layout` starts the session on every page. If the flag is off, any mounted Recommendation Shelf starts the session as a fallback when `userId` is missing (cookie + in-memory lock still limit this to one attempt per browser session).
26
26
 
27
27
  2. **Active VTEX Recommendations campaign.** Provide a valid campaign **VRN**. Example: `vrn:recommendations:my-account:rec-persona-v2:abc123`.
28
28
 
@@ -32,7 +32,19 @@ The shelf renders products only when the following conditions are met:
32
32
 
33
33
  ## Setup
34
34
 
35
- ### 1. Obtain the campaign VRN
35
+ ### 1. Opt into the personalization session (recommended)
36
+
37
+ In the store's `discovery.config.js` (or local override), set:
38
+
39
+ ```js
40
+ experimental: {
41
+ enableRecommendations: true,
42
+ }
43
+ ```
44
+
45
+ Default is `false`. With the flag on, `Layout` calls `startRecommendationSession` on every page without inspecting CMS data. With the flag off, placing a Recommendation Shelf on a page still starts the session when `userId` is missing.
46
+
47
+ ### 2. Obtain the campaign VRN
36
48
 
37
49
  In the VTEX Recommendations admin, create or select a campaign and copy its **VRN**. The expected format is:
38
50
 
@@ -42,9 +54,9 @@ vrn:recommendations:<account>:<campaign-type>:<campaign-id>
42
54
 
43
55
  Supported `<campaign-type>` values are listed under [Campaign types (VRN) and context](#campaign-types-vrn-and-context).
44
56
 
45
- ### 2. Add Recommendation Shelf via CMS
57
+ ### 3. Add Recommendation Shelf via CMS
46
58
 
47
- Add **Recommendation Shelf** to the target page (home, PDP, PLP, cart, and so on), configure at least **Campaign VRN** (required), and turn **Enable recommendations?** on.
59
+ Add **Recommendation Shelf** to the target page (home, PDP, PLP, cart, and so on) and configure at least **Campaign VRN** (required).
48
60
 
49
61
  ## CMS configuration
50
62
 
@@ -52,7 +64,6 @@ Schema: `cms/faststore/components/cms_component__recommendationshelf.jsonc`.
52
64
 
53
65
  | CMS property | Key | Type | Required | Default | Description |
54
66
  | --- | --- | --- | --- | --- | --- |
55
- | Enable recommendations? | `enableRecommendations` | boolean | No | `false` | Opt-in that starts the personalization session (via Layout) and allows this shelf to fetch recommendations. |
56
67
  | Title | `title` | string | No | — | Overrides the shelf title. Falls back to the campaign title. If both are empty, the heading is not rendered. |
57
68
  | Campaign VRN | `campaignVrn` | string | **Yes** | — | Recommendation campaign VRN. Validated by regex (see campaign types below). |
58
69
  | Items context | `itemsContext` | `PDP` \| `CART` | No | `PDP` | Source of products used as request context. Applies only to context-based campaigns. |
@@ -92,9 +103,9 @@ Context-based campaigns (cross-sell, similar items, visual similarity, next inte
92
103
 
93
104
  All recommendation work runs client-side after hydration:
94
105
 
95
- 1. **Session start (CMS opt-in)** — `Layout` calls `useStartRecommendationSession(pageProps)` once. The hook checks whether any `RecommendationShelf` in the CMS data has `enableRecommendations: true` and no-ops when none do. Multiple enabled shelves on the same page still start the session only once (in-memory lock + session cookie).
106
+ 1. **Session start (feature flag + shelf fallback)** — `Layout` calls `useStartRecommendationSession()` once. The hook starts the session when `experimental.enableRecommendations` is `true` (no CMS lookup). When the flag is `false`, `useRecommendationShelf()` (used by every RecommendationShelf) calls the same hook as a fallback while `userId` is missing (`undefined` or `null`), in parallel with cookie retry. Cookie (`vtex-rec-user-start-session`) + in-memory lock ensure at most one attempt per browser session. If `userId` is already available, the shelf does not start the session.
96
107
  2. **User id resolution** — `useRecommendationUserId()` reads the `vtex-rec-user-id` cookie, retrying until a value is available or the retry budget is exhausted.
97
- 3. **Request arguments** — when enabled, `getRecommendationArguments()` builds `{ userId, campaignVrn, products }` or returns `null` when the VRN is invalid, the user id is missing, or a context-based campaign has no context products. When disabled, arguments stay `null`.
108
+ 3. **Request arguments** — `getRecommendationArguments()` builds `{ userId, campaignVrn, products }` or returns `null` when the VRN is invalid, the user id is missing, or a context-based campaign has no context products.
98
109
  4. **Fetch** — `useRecommendations()` runs `ClientRecommendationsQuery` and returns `products`, `correlationId`, and `campaign`.
99
110
  5. **Render** — shows `ProductShelfSkeleton` while loading; returns `null` on error or empty results; otherwise renders the carousel and optional heading.
100
111
  6. **Tracking** — when correlation and campaign identifiers are present, the shelf emits `data-af-*` attributes for Activity Flow. PDP product views use `product:*` meta tags from `pages/[slug]/p.tsx`.
@@ -107,6 +118,7 @@ Related files:
107
118
  - Shelf: `src/components/sections/RecommendationShelf/`
108
119
  - Hook: `src/sdk/analytics/hooks/useStartRecommendationSession.ts`
109
120
  - Layout: `src/Layout.tsx`
121
+ - Flag: `discovery.config.default.js` → `experimental.enableRecommendations`
110
122
 
111
123
  ## Code-level overrides
112
124
 
@@ -116,7 +128,6 @@ In addition to CMS props, the component accepts code-level overrides (not expose
116
128
  import { RecommendationShelf } from 'src/components/sections/RecommendationShelf'
117
129
 
118
130
  <RecommendationShelf
119
- enableRecommendations
120
131
  campaignVrn="vrn:recommendations:my-account:rec-cross-v2:abc123"
121
132
  itemsContext="PDP"
122
133
  ProductCard={MyCustomCard}
@@ -143,7 +154,7 @@ As a global component, the shelf can be placed on any CMS page. Suggested placem
143
154
  - **Cart:** cross-sell with `itemsContext: CART`.
144
155
  - **PLP:** context-agnostic campaigns.
145
156
 
146
- The personalization session runs only when at least one shelf has **Enable recommendations?** turned on.
157
+ Prefer enabling `experimental.enableRecommendations` so the session is ready on every page. Stores without the flag and without a Recommendation Shelf never call `startRecommendationSession`.
147
158
 
148
159
  ## Privacy and cache
149
160
 
@@ -155,11 +166,10 @@ The personalization session runs only when at least one shelf has **Enable recom
155
166
 
156
167
  **The shelf does not render.** Check, in order:
157
168
 
158
- 1. Is **Enable recommendations?** set to `true` on the shelf?
159
- 2. Is `campaignVrn` valid and is the campaign active?
160
- 3. Is the `vtex-rec-user-id` cookie available? Without a user id, the shelf does not fetch.
161
- 4. For context-based campaigns, is product context available (`PDP` on a product page, or a non-empty cart for `CART`)?
162
- 5. Did the campaign return products? An empty response renders nothing by design.
169
+ 1. Is `campaignVrn` valid and is the campaign active?
170
+ 2. Is the `vtex-rec-user-id` cookie available? Without a user id, the shelf does not fetch. With the discovery flag off, confirm the shelf fallback started the session (`vtex-rec-user-start-session`).
171
+ 3. For context-based campaigns, is product context available (`PDP` on a product page, or a non-empty cart for `CART`)?
172
+ 4. Did the campaign return products? An empty response renders nothing by design.
163
173
 
164
174
  **Skeleton never resolves.** Inspect the console and the GraphQL `recommendations` response for pending or failing requests.
165
175
 
@@ -21,7 +21,6 @@ export function RecommendationShelf<
21
21
  >({
22
22
  title,
23
23
  campaignVrn,
24
- enableRecommendations = false,
25
24
  itemsContext = 'PDP',
26
25
  ProductCard,
27
26
  mapProductToProductCard,
@@ -56,7 +55,6 @@ export function RecommendationShelf<
56
55
  const { items, isLoading, error, campaign, correlationId } =
57
56
  useRecommendationShelf({
58
57
  campaignVrn,
59
- enableRecommendations,
60
58
  itemsContext,
61
59
  })
62
60
 
@@ -25,13 +25,6 @@ export type RecommendationShelfProps<
25
25
  > = {
26
26
  readonly title?: string
27
27
  readonly campaignVrn: string
28
- /**
29
- * Opt-in for VTEX Recommendations on this shelf. When `true`, Layout starts
30
- * the personalization session (`useStartRecommendationSession`) and this
31
- * shelf fetches recommendations. When `false` (default), neither happens.
32
- * @default false
33
- */
34
- readonly enableRecommendations?: boolean
35
28
  /**
36
29
  * Where to read the products used as context for the recommendation request:
37
30
  * - `'PDP'`: the current product detail page product.