@faststore/core 4.4.0-dev.2 → 4.4.0-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.4.0-dev.1 generate /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.4.0-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.4.0-dev.1 gen-types /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@4.4.0-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 /home/runner/work/faststore/faststore/packages/core/@generated/
20
20
  [COMPLETED] Generate outputs
21
21
 
22
- > @faststore/core@4.4.0-dev.1 cache-graphql /home/runner/work/faststore/faststore/packages/core
22
+ > @faststore/core@4.4.0-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,12 +1,13 @@
1
1
 
2
- > @faststore/core@4.4.0-dev.1 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.4.0-dev.2 test /home/runner/work/faststore/faststore/packages/core
3
3
  > vitest run
4
4
 
5
5
 
6
6
   RUN  v4.0.7 /home/runner/work/faststore/faststore/packages/core
7
7
 
8
8
  ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 32ms
9
- ✓  browser  test/sdk/session/installLocaleCorrector.browser.test.ts (7 tests) 59ms
9
+ ✓  browser  test/sdk/session/installLocaleCorrector.browser.test.ts (7 tests) 74ms
10
+ ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 14ms
10
11
  stderr | test/sdk/localization/store-url.browser.test.ts
11
12
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
12
13
  at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:119:27)
@@ -14,7 +15,6 @@
14
15
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:353:23)
15
16
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
16
17
 
17
- ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 8ms
18
18
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
19
19
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
20
20
 
@@ -100,6 +100,7 @@ act(() => {
100
100
  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
101
101
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
102
102
 
103
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 38ms
103
104
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > uses the fallback invalid-password message when API omits an error
104
105
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
105
106
 
@@ -244,19 +245,17 @@ act(() => {
244
245
  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
245
246
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
246
247
 
247
- ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1839ms
248
- ✓ renders the password protection form  848ms
249
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 33ms
250
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 21ms
251
- ✓  node  test/utils/match-url.test.ts (10 tests) 29ms
252
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 164ms
248
+ ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1502ms
249
+ ✓ renders the password protection form  667ms
250
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 22ms
251
+ ✓  node  test/utils/match-url.test.ts (10 tests) 34ms
252
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 145ms
253
253
  ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 34ms
254
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 579ms
255
- ✓ returns 405 for non-POST requests  366ms
254
+ ✓  node  test/pages/api/unlock.test.ts (15 tests) 790ms
255
+ ✓ returns 405 for non-POST requests  528ms
256
256
  stderr | test/components/search/SearchInputComponent.test.tsx
257
257
  Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
258
258
 
259
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 41ms
260
259
  stderr | test/components/search/SearchInputComponent.test.tsx > SearchInput (OES integration) > renders without crashing
261
260
  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.
262
261
  at div
@@ -317,16 +316,17 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
317
316
  at Suspense
318
317
  at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
319
318
 
320
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 292ms
321
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (12 tests) 29ms
322
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 111ms
323
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 113ms
324
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 19ms
325
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 139ms
319
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 198ms
320
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 40ms
321
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (12 tests) 37ms
322
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 218ms
323
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 99ms
324
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 17ms
326
325
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
327
326
  Set password request failed: Bad Request
328
327
 
329
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 99ms
328
+ ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 48ms
329
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 73ms
330
330
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
331
331
  Graphql execution returned with error: [
332
332
  {
@@ -374,29 +374,28 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
374
374
  ]
375
375
 
376
376
  ✓  node  test/pages/api/graphql.test.ts (10 tests) 22ms
377
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 48ms
378
- ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 40ms
379
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 38ms
380
- ✓  node  test/server/webops-api.test.ts (9 tests) 20ms
381
- ✓  node  test/proxy.test.ts (4 tests) 31ms
382
- ✓  node  test/server/index.test.ts (7 tests) 900ms
383
- ✓ should handle options and execute  369ms
384
- ✓  node  test/server/cms/global.test.ts (3 tests) 6ms
385
- ✓  node  test/sdk/localization/store-url.test.ts (1 test) 6ms
386
- ✓  node  test/server/content/service.test.ts (5 tests) 5ms
387
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 6ms
388
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 41ms
389
- ✓  node  test/pages/api/preview.test.ts (2 tests) 8ms
390
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 6ms
391
- ✓  node  test/components/search/SearchInput.test.ts (6 tests) 8ms
377
+ ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 59ms
378
+ ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 37ms
379
+ ✓  node  test/proxy.test.ts (4 tests) 50ms
380
+ ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 52ms
381
+ ✓  node  test/server/webops-api.test.ts (9 tests) 18ms
382
+ ✓  node  test/server/index.test.ts (7 tests) 667ms
383
+ ✓  node  test/server/cms/global.test.ts (3 tests) 7ms
384
+ ✓  node  test/sdk/localization/store-url.test.ts (1 test) 4ms
385
+ ✓  node  test/server/content/service.test.ts (5 tests) 4ms
386
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 7ms
387
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 32ms
388
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 6ms
389
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 4ms
392
390
  ✓  node  test/utils/unlockResponse.test.ts (11 tests) 5ms
391
+ ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
393
392
  ✓  node  test/server/cms/index.test.ts (2 tests) 6ms
394
- ✓  node  test/utils/isLocalHost.test.ts (7 tests) 5ms
395
- ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 4ms
396
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 27ms
393
+ ✓  node  test/utils/isLocalHost.test.ts (7 tests) 7ms
394
+ ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 3ms
395
+ ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 25ms
397
396
 
398
397
   Test Files  38 passed (38)
399
398
   Tests  363 passed (363)
400
-  Start at  14:16:16
401
-  Duration  25.18s (transform 6.88s, setup 0ms, collect 19.09s, tests 4.87s, environment 32.84s, prepare 1.03s)
399
+  Start at  13:16:14
400
+  Duration  23.17s (transform 6.25s, setup 0ms, collect 17.58s, tests 4.44s, environment 28.99s, prepare 945ms)
402
401
 
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.4.0-dev.3](https://github.com/vtex/faststore/compare/v4.4.0-dev.2...v4.4.0-dev.3) (2026-06-29)
7
+
8
+ ### Bug Fixes
9
+
10
+ - sync IS locale with URL and selectedFacets on navigation ([#3405](https://github.com/vtex/faststore/issues/3405)) ([90d644d](https://github.com/vtex/faststore/commit/90d644dcf7a232c3f2bea316658580b10108b502)), closes [#3401](https://github.com/vtex/faststore/issues/3401) [#3401](https://github.com/vtex/faststore/issues/3401)
11
+
6
12
  # [4.4.0-dev.2](https://github.com/vtex/faststore/compare/v4.4.0-dev.1...v4.4.0-dev.2) (2026-06-25)
7
13
 
8
14
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "4.4.0-dev.2",
3
+ "version": "4.4.0-dev.3",
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/diagnostics": "4.4.0-dev.2",
75
- "@faststore/api": "4.4.0-dev.2",
76
- "@faststore/lighthouse": "4.4.0-dev.2",
77
- "@faststore/sdk": "4.4.0-dev.2",
78
- "@faststore/ui": "4.4.0-dev.2"
74
+ "@faststore/api": "4.4.0-dev.3",
75
+ "@faststore/diagnostics": "4.4.0-dev.3",
76
+ "@faststore/sdk": "4.4.0-dev.3",
77
+ "@faststore/lighthouse": "4.4.0-dev.3",
78
+ "@faststore/ui": "4.4.0-dev.3"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@cypress/code-coverage": "^3.12.1",
@@ -1,7 +1,9 @@
1
1
  import { useMemo } from 'react'
2
2
 
3
3
  import type { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
4
+ import { useRouter } from 'next/router'
4
5
 
6
+ import storeConfig from 'discovery.config'
5
7
  import { ITEMS_PER_SECTION } from 'src/constants'
6
8
  import { useSession } from 'src/sdk/session'
7
9
  import { toArray } from 'src/utils/utilities'
@@ -14,7 +16,18 @@ export const useLocalizedVariables = ({
14
16
  selectedFacets,
15
17
  sponsoredCount,
16
18
  }: Partial<ClientManyProductsQueryQueryVariables>) => {
17
- const { channel, locale } = useSession()
19
+ const { channel, locale: sessionLocale } = useSession()
20
+ const router = useRouter()
21
+
22
+ // Prefer router.locale over session.locale: Next.js i18n exposes the locale
23
+ // prefix as router.locale (always current), while session.locale can lag on
24
+ // navigation.
25
+ const locale = useMemo(() => {
26
+ if (storeConfig.localization?.enabled) {
27
+ return router.locale ?? sessionLocale
28
+ }
29
+ return sessionLocale
30
+ }, [router.locale, sessionLocale])
18
31
 
19
32
  return useMemo(() => {
20
33
  return {