@faststore/core 4.7.0-dev.2 → 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.1 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.1 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.1 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,24 +1,25 @@
1
1
 
2
- > @faststore/core@4.7.0-dev.1 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) 943ms
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/ContractSwitcher.browser.test.tsx (13 tests) 2342ms
15
- ✓ shows an error state when the list fails to load  612ms
16
- ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  319ms
17
- ✓ keeps Confirm disabled until a different contract is selected  325ms
18
- ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 277ms
19
- ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (14 tests) 1907ms
20
- ✓ shows the tab bar and renders Personal cards by default  971ms
21
- ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 27ms
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
22
23
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
23
24
  Error in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
24
25
   at node:internal/deps/undici/undici:16416:13
@@ -48,9 +49,7 @@ Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
48
49
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
49
50
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
50
51
 
51
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (10 tests) 171ms
52
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 223ms
53
- ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 17ms
52
+ ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (7 tests) 255ms
54
53
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
55
54
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
56
55
 
@@ -280,11 +279,13 @@ act(() => {
280
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
281
280
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
282
281
 
283
- ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1146ms
284
- ✓ renders the password protection form  600ms
285
- ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 52ms
286
- ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1220ms
287
- ✓ renders the menu view with contract details and manage footer  623ms
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
288
289
  stderr | test/sdk/localization/store-url.browser.test.ts
289
290
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
290
291
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -293,10 +294,11 @@ This ensures that you're testing the behavior the user would see in the browser.
293
294
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
294
295
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
295
296
 
296
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 6ms
297
- ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 28ms
298
- ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 37ms
299
- ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 28ms
297
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 5ms
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
300
302
  stderr | test/components/account/doLogout.browser.test.ts
301
303
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
302
304
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -305,9 +307,10 @@ This ensures that you're testing the behavior the user would see in the browser.
305
307
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
306
308
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
307
309
 
308
- ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 23ms
309
- ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 68ms
310
- ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 242ms
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
311
314
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
312
315
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
313
316
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -316,10 +319,11 @@ This ensures that you're testing the behavior the user would see in the browser.
316
319
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
317
320
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
318
321
 
319
- ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 240ms
320
322
  ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 5ms
321
323
  ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 8ms
322
324
  ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 3ms
325
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 19ms
326
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 34ms
323
327
  stderr | test/sdk/account/refreshToken.browser.test.ts
324
328
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
325
329
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -328,14 +332,12 @@ This ensures that you're testing the behavior the user would see in the browser.
328
332
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
329
333
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
330
334
 
331
- ✓  browser  test/sdk/account/refreshToken.browser.test.ts (1 test) 8ms
332
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 28ms
333
- ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 32ms
334
- ✓  node  test/utils/match-url.test.ts (10 tests) 11ms
335
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 29ms
336
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 267ms
337
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 10ms
338
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 9ms
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
339
341
  stderr | test/components/search/SearchInputComponent.test.tsx
340
342
  Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
341
343
 
@@ -399,18 +401,18 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
399
401
  at Suspense
400
402
  at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
401
403
 
402
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 78ms
403
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 44ms
404
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 13ms
404
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 74ms
405
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 59ms
406
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 12ms
405
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
406
408
  { extensions: { status: 401 } }
407
409
 
408
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
409
411
  { extensions: { status: 502 } }
410
412
 
411
- ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 11ms
412
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 25ms
413
- ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 9ms
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
414
416
  ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 380ms
415
417
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
416
418
  Graphql execution returned with error: [
@@ -504,65 +506,63 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
504
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
505
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)
506
508
 
507
- ✓  node  test/pages/api/graphql.test.ts (17 tests) 36ms
509
+ ✓  node  test/pages/api/graphql.test.ts (17 tests) 29ms
508
510
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
509
511
  Set password request failed: Bad Request
510
512
 
511
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 30ms
512
- ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 821ms
513
- ✓ navigates with the search term on blur  361ms
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
514
516
  ✓ navigates without a label param when the search is cleared  359ms
515
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 39ms
516
- ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 34ms
517
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 7ms
518
- ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 7ms
519
- ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (12 tests) 6ms
520
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 48ms
521
- ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 137ms
522
- ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 39ms
523
- ✓  node  test/server/index.test.ts (7 tests) 916ms
524
- ✓ should handle options and execute  385ms
525
- ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 47ms
526
- ✓  node  test/proxy.localization.test.ts (5 tests) 36ms
527
- ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (6 tests) 8ms
528
- ✓  node  test/proxy.test.ts (4 tests) 15ms
529
- ✓  node  test/server/webops-api.test.ts (9 tests) 15ms
517
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 30ms
518
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 5ms
519
+ ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 25ms
520
+ ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 5ms
521
+ ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (12 tests) 9ms
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
534
+ ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 7ms
530
535
  ✓  node  test/server/content/service.test.ts (5 tests) 5ms
531
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 42ms
532
- ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 110ms
533
- ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 10ms
534
- ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 10ms
535
- ✓  node  test/server/cms/global.test.ts (3 tests) 5ms
536
- ✓  node  test/sdk/localization/store-url.test.ts (1 test) 4ms
537
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 29ms
538
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 119ms
539
- ✓  node  test/sdk/analytics/hasEnabledRecommendationShelf.test.ts (6 tests) 5ms
540
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 6ms
536
+ ✓  node  test/server/cms/global.test.ts (3 tests) 6ms
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
541
  ✓  node  test/server/rootSpan.test.ts (4 tests) 39ms
542
- ✓  node  test/pages/api/preview.test.ts (2 tests) 9ms
543
- ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
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
544
545
  ✓  node  test/components/account/Layout.test.tsx (6 tests) 63ms
545
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
546
- ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 5ms
547
- ✓  node  test/utils/retry.test.ts (5 tests) 13ms
548
- ✓  node  test/server/cms/index.test.ts (2 tests) 5ms
549
- ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 5ms
550
- ✓  node  test/utils/unlockResponse.test.ts (11 tests) 8ms
546
+ ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 4ms
547
+ ✓  node  test/utils/retry.test.ts (5 tests) 14ms
548
+ ✓  node  test/server/cms/index.test.ts (2 tests) 6ms
549
+ ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 4ms
550
+ ✓  node  test/utils/unlockResponse.test.ts (11 tests) 4ms
551
551
  ✓  node  test/server/cms/myAccountDefaultSections.test.ts (5 tests) 4ms
552
- ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 188ms
553
- ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 4ms
554
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 38ms
552
+ ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 191ms
553
+ ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 5ms
555
554
  ✓  node  test/utils/isLocalHost.test.ts (7 tests) 4ms
555
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 54ms
556
556
  ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 3ms
557
- ✓  node  test/utils/getCookie.test.ts (4 tests) 4ms
557
+ ✓  node  test/utils/getCookie.test.ts (4 tests) 5ms
558
558
  ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 4ms
559
- ✓  node  test/instrumentation.test.ts (3 tests) 6ms
560
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 28ms
561
- ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 31ms
562
- ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 10ms
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
563
563
 
564
564
   Test Files  87 passed (87)
565
-  Tests  698 passed (698)
566
-  Start at  20:10:15
567
-  Duration  41.13s (transform 9.78s, setup 0ms, import 36.14s, tests 13.03s, environment 52.30s)
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)
568
568
 
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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
+
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)
19
+
20
+ **Note:** Version bump only for package @faststore/core
21
+
6
22
  # [4.7.0-dev.2](https://github.com/vtex/faststore/compare/v4.7.0-dev.1...v4.7.0-dev.2) (2026-08-24)
7
23
 
8
24
  ### Bug Fixes
@@ -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.2",
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.2",
75
- "@faststore/diagnostics": "4.7.0-dev.2",
76
- "@faststore/lighthouse": "4.7.0-dev.2",
77
- "@faststore/sdk": "4.7.0-dev.2",
78
- "@faststore/ui": "4.7.0-dev.2"
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.