From c372032c30ad63ccf319408a17401a0d2b7986a0 Mon Sep 17 00:00:00 2001 From: BrianMuenzenmeyer Date: Tue, 4 Nov 2025 10:54:39 -0600 Subject: [PATCH 1/4] attempt to use arm as default for mac --- .../site/hooks/react-client/__tests__/useDetectOS.test.mjs | 2 +- apps/site/hooks/react-client/useDetectOS.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs b/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs index ce9616ae418ad..fa540d612fade 100644 --- a/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs +++ b/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs @@ -72,7 +72,7 @@ describe('useDetectOS', () => { assert.deepEqual(result.current, { os: 'MAC', bitness: '32', - architecture: 'x86', + architecture: 'arm64', }); }); }); diff --git a/apps/site/hooks/react-client/useDetectOS.ts b/apps/site/hooks/react-client/useDetectOS.ts index dc2d2cfcdf244..4c421be90d715 100644 --- a/apps/site/hooks/react-client/useDetectOS.ts +++ b/apps/site/hooks/react-client/useDetectOS.ts @@ -28,10 +28,12 @@ const useDetectOS = () => { navigator.userAgent ); + const os = detectOS(); + // We immediately set the OS to LOADING, and then we update it with the detected OS. // This is due to that initial render set within the state will indicate a mismatch from // the server-side rendering versus what the initial state is from the client-side - setUserOSState(current => ({ ...current, os: detectOS() })); + setUserOSState(current => ({ ...current, os })); // We attempt to get the high entropy values from the Browser and set the User OS State // based from the values we get from the Browser, if it fails we fallback to the User Agent @@ -41,7 +43,8 @@ const useDetectOS = () => { // If there is no getHighEntropyValues API on the Browser or it failed to resolve // we attempt to fallback to what the User Agent indicates bitness = uaIndicates64 ? '64' : '32', - architecture = 'x86', + // we assume that MacOS has moved to arm64 by default now + architecture = os === 'MAC' ? 'arm64' : 'x86', }) => { setUserOSState(current => ({ ...current, From 1feba0bad84763c36d42ede1db8ab9369a4b0ee3 Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Wed, 5 Nov 2025 17:38:29 +0100 Subject: [PATCH 2/4] fix: there's no such architecture arm64 --- apps/site/hooks/react-client/useDetectOS.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/site/hooks/react-client/useDetectOS.ts b/apps/site/hooks/react-client/useDetectOS.ts index 4c421be90d715..8e203f8f640ed 100644 --- a/apps/site/hooks/react-client/useDetectOS.ts +++ b/apps/site/hooks/react-client/useDetectOS.ts @@ -7,7 +7,7 @@ import type { Bitness, OperatingSystem, } from '#site/types/userAgent'; -import { getHighEntropyValues, detectOS } from '#site/util/userAgent'; +import { detectOS, getHighEntropyValues } from '#site/util/userAgent'; type UserOSState = { os: OperatingSystem | 'LOADING'; @@ -42,10 +42,12 @@ const useDetectOS = () => { ({ // If there is no getHighEntropyValues API on the Browser or it failed to resolve // we attempt to fallback to what the User Agent indicates - bitness = uaIndicates64 ? '64' : '32', + bitness = os === 'MAC' || uaIndicates64 ? '64' : '32', // we assume that MacOS has moved to arm64 by default now - architecture = os === 'MAC' ? 'arm64' : 'x86', + architecture = os === 'MAC' ? 'arm' : 'x86', }) => { + console.log({ bitness, architecture }); + setUserOSState(current => ({ ...current, bitness: bitness as Bitness, From d5e7c8ffbad08df6bfd045325280319c1a01231f Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Wed, 5 Nov 2025 17:41:12 +0100 Subject: [PATCH 3/4] chore: removed console.log --- apps/site/hooks/react-client/useDetectOS.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/site/hooks/react-client/useDetectOS.ts b/apps/site/hooks/react-client/useDetectOS.ts index 8e203f8f640ed..f7da9ebacfd2f 100644 --- a/apps/site/hooks/react-client/useDetectOS.ts +++ b/apps/site/hooks/react-client/useDetectOS.ts @@ -46,8 +46,6 @@ const useDetectOS = () => { // we assume that MacOS has moved to arm64 by default now architecture = os === 'MAC' ? 'arm' : 'x86', }) => { - console.log({ bitness, architecture }); - setUserOSState(current => ({ ...current, bitness: bitness as Bitness, From 5147f1a8526e0c550f19e565d77df85a663aeddd Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Wed, 5 Nov 2025 17:56:23 +0100 Subject: [PATCH 4/4] fix: test --- apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs b/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs index fa540d612fade..f1b644c6af2f9 100644 --- a/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs +++ b/apps/site/hooks/react-client/__tests__/useDetectOS.test.mjs @@ -71,8 +71,8 @@ describe('useDetectOS', () => { await waitFor(() => { assert.deepEqual(result.current, { os: 'MAC', - bitness: '32', - architecture: 'arm64', + bitness: '64', + architecture: 'arm', }); }); });