App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-28] [$175] Account settings - Device management shows Windows 10 for a device running Windows 11.

Open applause-bot[bot] opened this issue 1 month ago • 41 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: https://staging.new.expensify.com/ Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/tc/TC-628681 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Chrome, Windows 11 App Component: Other

Action Performed:

Preconditions: User is logged in on a laptop running Windows 11.

Steps to reproduce:

1- Open https://staging.new.expensify.com in Chrome on a Windows 11 laptop. 2- Log in to the account. 3- Go to Account → Security → Device management. 4- Look at the operating system shown for the current, logged-in device.

Expected Result:

The current device’s operating system is shown as Windows 11.

Actual Result:

The current device’s operating system is shown as Windows 10.

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [ ] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

Image Image

View all open jobs on GitHub

Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7294772

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

applause-bot[bot] avatar Oct 23 '26 20:10 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/33746d4eb11f862369e3c58e2532e02585fa7da8672709085651b5d15bd4ad44

https://platform.applause.com/services/links/v1/external/6303ff3472022dd4ad78929da1fbafcdf5643c6ff89bded33d8e22c39eb5d591

applause-bot[bot] avatar Oct 23 '26 20:10 applause-bot[bot]

Proposal

What is the root cause of that problem?

The web client gets the OS version from the browser's User-Agent string, and on Windows 11 that string still says Windows NT 10.0. Browsers froze this value, so Windows 10 and Windows 11 send the same thing.

getOSAndName() in expensify-common parses navigator.userAgent with ua-parser-js, which maps NT 10.0 to "10". The client sends that value to the backend as deviceInfo at sign-in, and the page shows it as-is.

Code path

What changes do you think we should make in order to solve the problem?

Use User-Agent Client Hints to find the real Windows version on browsers that support them:

  1. Add an async web-only helper next to getOSAndName. When os is Windows and navigator.userAgentData?.getHighEntropyValues exists, it calls getHighEntropyValues(['platformVersion']). If the major version is 13 or higher, it sets osVersion to "11".
  2. Await that helper in getDeviceInfoWithID(), which already returns a Promise. Native platforms keep their current react-native-device-info path.
  3. Wrap the lookup in try/catch so the current value stays when the API fails or doesn't exist. Firefox and Safari don't support it.
  4. Leave the synchronous getOSAndName() signature as it is. src/libs/Browser/index.web.ts also uses it.
  5. Add a unit test that mocks userAgentData for Windows 10 (platformVersion 10.0.0), Windows 11 (15.0.0), and the API being missing.

Devices that are already stored keep showing "Windows 10" until the user signs in again on that device.

What alternative solutions did you explore? (Optional)

  • Fix it in expensify-common Device.ts. It already has the iOS 26 special case, but the function is synchronous, so it would need a new async variant and a package bump.
  • Detect the version on the backend. The backend can request the Sec-CH-UA-Platform-Version header. This needs backend work and would also fix existing records, but it is outside the App repo.
Confidence and open questions

Confidence: medium-high. The client-side cause is confirmed in the code. I didn't check whether the backend changes deviceInfo before storing it. The returned fields (app_version, timestamp) match what the client sends, which suggests the backend passes them through unchanged. This can't be reproduced in a Linux test browser, so I didn't run a UI test.

The feature came from #2 - Add device management feature. I didn't find related open issues.


Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104910) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run

MelvinBot avatar Oct 23 '26 20:10 MelvinBot

Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External)

melvin-bot[bot] avatar Oct 23 '26 20:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022113729183708024443

melvin-bot[bot] avatar Oct 23 '26 20:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01af851c9a7f771775

Proposal

Please re-state the problem that we are trying to solve in this issue.

The Device management page in Account settings displays Windows 10 for devices running Windows 11.

What is the root cause of that problem?

Modern Chromium browsers freeze the user agent token to Windows NT 10.0 on both Windows 10 and Windows 11 to avoid web compatibility regressions. getOSAndName in src/libs/actions/Device/getDeviceInfo/getOSAndName/index.ts re-exports directly from expensify-common/Device, which only inspects navigator.userAgent and misidentifies Windows 11 as Windows 10. Accurately distinguishing Windows 11 requires querying the User-Agent Client Hints API (navigator.userAgentData.getHighEntropyValues(['platformVersion'])), where a major platform version of 13 or higher corresponds to Windows 11.

What changes do you think we should make in order to solve the problem?

  1. In src/libs/actions/Device/getDeviceInfo/getOSAndName/index.ts: Keep the synchronous getOSAndName export backwards-compatible with its existing callers, such as src/libs/Browser/index.web.ts and getDeviceInfo/index.ts. Maintain an in-memory cache for detected OS details. When getOSAndName is called, return the cached result if available, or fall back to expensify-common/Device. Export an asynchronous helper that inspects navigator.userAgentData?.getHighEntropyValues?.(['platformVersion']). When the base OS detected is Windows and parseInt(platformVersion.split('.')[0], 10) >= 13, set the cached osVersion to '11'.

  2. In src/libs/actions/Device/index.ts: In getDeviceInfoWithID(), invoke the Client Hints detection helper before serializing getDeviceInfo(). Wrap the detection promise with a .catch(() => {}) and a Promise.race fallback timeout (e.g. 500ms) so that unsupported browsers, slow IPC responses, or rejections never stall authentication commands such as SignInUser or BeginSignIn.

  3. In tests/unit/DeviceTest.ts: Add unit tests verifying that getOSAndName and getDeviceInfoWithID output osVersion: '11' when client hints report a major platform version >= 13, and preserve 10 when client hints are unsupported or report an older build.

What alternative solutions did you explore? (Optional)

I also considered converting getOSAndName directly into an asynchronous function that awaits getHighEntropyValues. That breaks synchronous consumers like src/libs/Browser/index.web.ts and forces async refactoring across getDeviceInfo. I also evaluated reading Electron process.getSystemVersion(), but renderer context isolation prevents access to Node process globals without custom preload bindings, whereas Chromium Client Hints works out of the box across both web and modern desktop environments.

taieddie avatar Oct 23 '26 20:10 taieddie

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 23 '26 20:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0153b0634202bc9e52

Proposal

Please re-state the problem that we are trying to solve in this issue.

Device management shows "Chrome xxx (Windows 10)" for a device running Windows 11.

What is the root cause of that problem?

On web, getDeviceInfoWithID() in src/libs/actions/Device/index.ts serializes getDeviceInfo(), which gets os and osVersion from getOSAndName() in expensify-common. That function parses navigator.userAgent with ua-parser-js 1.0.41. Browsers froze the Windows token at Windows NT 10.0, so Windows 10 and Windows 11 send the same User-Agent and the parser returns osVersion: "10" for both. The value is sent as deviceInfo with SignInUser, BeginSignIn and the other sign-in commands, and getDeviceDisplayName() in UserUtils.ts shows it as is.

The only way to tell Windows 11 apart in the browser is User-Agent Client Hints: navigator.userAgentData.getHighEntropyValues(['platformVersion']) returns 13.0.0 or higher on Windows 11, 1.0.0 to 10.0.0 on Windows 10 and 0.x on Windows 7/8/8.1 (Microsoft docs).

What changes do you think we should make in order to solve the problem?

  1. Add src/libs/actions/Device/getDeviceInfo/resolveWindowsVersion.ts, an async helper that takes the device info and:
    • returns it unchanged unless os === 'Windows' and navigator.userAgentData?.getHighEntropyValues exists. This also makes it a no-op on iOS and Android, where os is never Windows, so no .native file is needed.
    • requests platformVersion and sets osVersion to '11' only when the major version is 13 or higher. Every other value (Windows 10, Windows 7/8.x 0.x, empty or unparsable) keeps what the User-Agent gave us, so we never report a version we are not sure about.
    • wraps the call in try/catch, so a rejected promise or a synchronous throw falls back to the User-Agent value. Sign-in waits on this, so it must always settle.
  2. In getDeviceInfoWithID(), run getDeviceID() and resolveWindowsVersion(getDeviceInfo()) with Promise.all. The function already returns a Promise and all 10 callers (8 in Session/index.ts, 2 in User.ts) already use .then(), so no caller changes. The two lookups run in parallel, so sign-in is not delayed by an extra sequential step.
  3. Keep the synchronous getOSAndName() as it is, since Browser/index.web.ts uses it for the iOS 26 check.
  4. Add the userAgentData type to src/types/modules/navigator.d.ts. The TypeScript DOM lib does not include it yet.
  5. Add tests/unit/resolveWindowsVersionTest.ts: 15.0.0 and 13.0.0 give 11; 10.0.0, 0.3.0 and an empty value keep 10; API missing, rejecting or throwing keeps the original object; non-Windows devices never call the API.

I have this implemented locally with the tests passing, along with UserTest and SessionTest, typecheck and lint.

Note: devices that are already stored keep their old label until that device signs in again.

What alternative solutions did you explore? (Optional)

  • Fix it in expensify-common Device.ts, next to the iOS 26 case. getOSAndName() is synchronous and is used synchronously in Browser/index.web.ts, so it would need a second async export plus a package bump and a version update in App for a one-field change. The Client Hints call is App's concern of what we send at sign-in, so I kept it in App.
  • Upgrade to ua-parser-js 2.x and use withClientHints(), which does the same detection. Version 2 is AGPL licensed (1.x is MIT), so it is not an option.
  • Backend reads Sec-CH-UA-Platform-Version via Accept-CH. This would also fix already stored rows, but needs backend work. It is worth doing only if the backend recomputes os from the User-Agent header, which I cannot verify from App.
  • Timeout around the Client Hints call. Chromium resolves getHighEntropyValues from data the browser already has, and the try/catch covers rejection, so I did not add a timer to the sign-in path. Easy to add if reviewers prefer it.

arkh1episkop avatar Oct 23 '26 21:10 arkh1episkop

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 23 '26 21:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

The Device management page in Account settings displays "Windows 10" for devices running Windows 11.

What is the root cause of that problem?

Modern Chromium browsers freeze the user-agent string token to Windows NT 10.0 for both Windows 10 and Windows 11 to prevent legacy web-compatibility regressions.

In the frontend codebase:

  • getOSAndName() in src/libs/actions/Device/getDeviceInfo/getOSAndName/index.ts re-exports directly from expensify-common/Device.
  • expensify-common parses navigator.userAgent using ua-parser-js (which maps NT 10.0 to "10").
  • At authentication time, getDeviceInfoWithID() (src/libs/actions/Device/index.ts) serializes getDeviceInfo(), sending os: "Windows" and osVersion: "10" to the backend (SignInUser, BeginSignIn, SignUpUser, etc.).
  • When rendering active sessions in Device management, getDeviceDisplayName() in src/libs/UserUtils.ts displays the stored os and osVersion, incorrectly showing "Windows 10" on Windows 11 systems.

The only standard web API capable of distinguishing Windows 11 from Windows 10 is the User-Agent Client Hints API: navigator.userAgentData.getHighEntropyValues(['platformVersion']). Under Microsoft's Chromium platform specification, a major version >= 13 corresponds to Windows 11, while versions < 13 (e.g., 10.0.0, 1.0.0) represent Windows 10 or earlier.

What changes do you think we should make in order to solve the problem?

To maintain backward compatibility with synchronous consumers of getOSAndName() (such as src/libs/Browser/index.web.ts and getDeviceInfo() calls), we resolve Windows 11 asynchronously inside getDeviceInfoWithID() where authentication payloads are prepared:

  1. Create an asynchronous Windows version resolver: Add src/libs/actions/Device/getDeviceInfo/resolveWindowsVersion.ts:

    • Inspects the device info: if os !== 'Windows' or !navigator?.userAgentData?.getHighEntropyValues, returns the base device info immediately without overhead (safely no-ops on iOS/Android native platforms and browsers lacking Client Hints).
    • Calls navigator.userAgentData.getHighEntropyValues(['platformVersion']) wrapped in a defensive try / catch.
    • Parses parseInt(platformVersion.split('.')[0], 10): if majorVersion >= 13, sets osVersion: '11'. Any other status, older version, or error preserves the parsed osVersion ("10").
  2. Parallelize device ID generation & version resolution: In src/libs/actions/Device/index.ts:

    function getDeviceInfoWithID(): Promise<DeviceInfoPayload> {
        return Promise.all([
            getDeviceID(),
            resolveWindowsVersion(getDeviceInfo()),
        ]).then(([deviceID, deviceInfo]) => ({
            ...deviceInfo,
            deviceID,
        }));
    }
    

    Because getDeviceInfoWithID() already returns a Promise, all upstream callers (in Session and User) continue working with zero breaking changes or latency degradation.

  3. Declare TypeScript Navigator interface: In src/types/modules/navigator.d.ts, declare the typing for navigator.userAgentData and getHighEntropyValues so the build typechecks cleanly without any bypasses.

  4. User Mutation & Persistence Edge Cases:

    • Session Lifecycle: Device metadata is captured at sign-in. Existing sessions already stored on the server will show "Windows 10" until that session re-authenticates or the user signs in again.
    • Client Mutation: In-flight changes to settings or profile edits do not overwrite deviceInfo; the accurately resolved Windows 11 tag persists cleanly in Onyx session.deviceInfo.

What alternative solutions did you explore? (Optional)

  • Making getOSAndName() asynchronous: Modifying getOSAndName to return a Promise breaks synchronous consumers like src/libs/Browser/index.web.ts and cascades async requirements into synchronous utilities across the app.
  • Updating expensify-common: getOSAndName in expensify-common is strictly synchronous and shared across internal microservices. Introducing an async variant requires a coordinated multi-repo release and package bump for a client-side display enhancement.
  • Upgrading ua-parser-js to v2: Version 2 includes client hints support but changed licensing from MIT to dual AGPL/commercial, which is prohibited under Expensify repository guidelines.

What automated tests can you add to prevent this from re-occurring?

Add unit tests in tests/unit/resolveWindowsVersionTest.ts:

  • Mock navigator.userAgentData.getHighEntropyValues returning platformVersion: '15.0.0' -> verify osVersion resolves to '11'.
  • Mock navigator.userAgentData.getHighEntropyValues returning platformVersion: '10.0.0' -> verify osVersion remains '10'.
  • Mock getHighEntropyValues rejecting with an exception -> verify fallback returns initial deviceInfo gracefully.
  • Mock non-Windows OS (macOS, Linux, Android, iOS) -> verify getHighEntropyValues is never invoked.

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83

camesenin avatar Oct 23 '26 23:10 camesenin

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 23 '26 23:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0139ed4098bdc50182

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a user signs in to New Expensify on Chrome running on Windows 11 and navigates to Account → Security → Device management, the current session's operating system is displayed as Windows 10 (e.g., Chrome 1xx (Windows 10)) instead of Windows 11.

What is the root cause of that problem?

  1. Modern Chromium-based browsers permanently froze the Windows platform token inside the legacy navigator.userAgent string at Windows NT 10.0 on Windows 11 to avoid breaking legacy user-agent parsers.
  2. On Web/Desktop, src/libs/actions/Device/getDeviceInfo/getOSAndName/index.ts re-exports getOSAndName() from expensify-common/Device, which parses navigator.userAgent synchronously via ua-parser-js (1.0.41) and maps Windows NT 10.0 to os: "Windows" and osVersion: "10".
  3. During sign-in (SignInUser, BeginSignIn, SignUpUser, etc.), getDeviceInfoWithID() in src/libs/actions/Device/index.ts:58-69 serializes getDeviceInfo() directly into the deviceInfo payload without querying the User-Agent Client Hints API (navigator.userAgentData.getHighEntropyValues(['platformVersion'])).
  4. When DeviceManagementPage.tsx:46-47 renders each login item, it passes item.additionalData (os, osVersion) to getDeviceDisplayName() in src/libs/UserUtils.ts:153, displaying (Windows 10).

What changes do you think we should make in order to solve the problem?

We should resolve the accurate Windows version via User-Agent Client Hints (navigator.userAgentData.getHighEntropyValues(['platformVersion']), where major platformVersion >= 13 identifies Windows 11 per Microsoft's Chromium specification) inside the asynchronous getDeviceInfoWithID() pipeline while keeping getOSAndName() synchronous for existing callers like src/libs/Browser/index.web.ts:78:

  1. Declare navigator.userAgentData types in src/types/modules/navigator.d.ts:
type UADataValues = {
    platformVersion?: string;
};

type NavigatorUAData = {
    getHighEntropyValues?: (hints: string[]) => Promise<UADataValues>;
};

declare global {
    // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
    interface Navigator {
        userLanguage: string;
        userAgentData?: NavigatorUAData;
    }
}

export {};
  1. Add an async helper src/libs/actions/Device/getDeviceInfo/resolveWindowsVersion.ts:
import type {DeviceInfo} from './types';

const WINDOWS_11_MIN_PLATFORM_MAJOR_VERSION = 13;

async function resolveWindowsVersion(deviceInfo: DeviceInfo): Promise<DeviceInfo> {
    if (deviceInfo.os !== 'Windows' || typeof navigator === 'undefined' || !navigator.userAgentData?.getHighEntropyValues) {
        return deviceInfo;
    }

    try {
        const {platformVersion} = await navigator.userAgentData.getHighEntropyValues(['platformVersion']);
        const majorVersion = Number.parseInt(platformVersion?.split('.')[0] ?? '', 10);
        if (majorVersion >= WINDOWS_11_MIN_PLATFORM_MAJOR_VERSION) {
            return {
                ...deviceInfo,
                osVersion: '11',
            };
        }
    } catch {
        // Fall back to the UA-parsed osVersion if Client Hints fails or rejects
    }

    return deviceInfo;
}

export default resolveWindowsVersion;
  1. Run getDeviceID() and resolveWindowsVersion(getDeviceInfo()) in parallel in src/libs/actions/Device/index.ts:
function getDeviceInfoWithID(): Promise<string> {
    return Promise.all([getDeviceID(), resolveWindowsVersion(getDeviceInfo())]).then(([currentDeviceID, deviceInfo]) =>
        JSON.stringify({
            ...deviceInfo,
            deviceID: currentDeviceID,
        }),
    );
}

Running both promises via Promise.all adds zero sequential delay to sign-in calls, requires no .native file split (since deviceInfo.os !== 'Windows' short-circuits on iOS/Android), and preserves synchronous getOSAndName() callers.

What alternative solutions did you explore? (Optional)

  • Changing getOSAndName() in expensify-common to be async: getOSAndName() is called synchronously in src/libs/Browser/index.web.ts:78 (isMobileSafariOnIos26). Making it asynchronous would break synchronous browser-detection utilities and require a cross-repo package bump.
  • Upgrading ua-parser-js to v2.x: ua-parser-js v2.x switched from MIT to dual AGPLv3/PRO licensing, which is incompatible with Expensify's dependency policy.

bonnhatnguyen avatar Oct 24 '26 11:10 bonnhatnguyen

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 24 '26 11:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When signing in on a device running Windows 11, Account > Security > Device management displays the session as (Windows 10) (e.g., Chrome 147.0.0.0 (Windows 10)) instead of (Windows 11).

What is the root cause of that problem?

  1. During sign-in (beginSignIn / signInUser in src/libs/actions/Session/index.ts), the app calls Device.getDeviceInfoWithID() (src/libs/actions/Device/index.ts#L53-L63), which serializes getDeviceInfo() (src/libs/actions/Device/getDeviceInfo/index.ts#L1-L9).
  2. On web, getDeviceInfo() spreads getOSAndName() (src/libs/actions/Device/getDeviceInfo/getOSAndName/index.ts#L1-L3), which re-exports getOSAndName from expensify-common/lib/Device.ts.
  3. In expensify-common/lib/Device.ts, getOSAndName() runs new UAParser().getResult() against navigator.userAgent and returns:
    return {
        os: os.name,
        osVersion,
        deviceName: browser.name,
        deviceVersion: browser.version,
    };
    
  4. Under the User-Agent Reduction specification, all Chromium-based browsers (Chrome, Edge, Brave, Opera) on Windows 11 permanently freeze the legacy navigator.userAgent token at Windows NT 10.0. Consequently, UAParser always parses os.name === 'Windows' and os.version === '10', so getDeviceInfo() returns {os: 'Windows', osVersion: '10', ...} (note: the property returned by getOSAndName() and read by DeviceManagementPage.tsx#L46 / getDeviceDisplayName in src/libs/UserUtils.ts#L154-L156 is os, not osName).
  5. Per Microsoft's User-Agent Client Hints specification for Windows 11 detection, browsers distinguish Windows 11 from Windows 10 via the asynchronous High-Entropy Client Hints API navigator.userAgentData.getHighEntropyValues(['platformVersion']), where a major platformVersion >= 13 indicates Windows 11 (1–10 indicates Windows 10).

What changes do you think we should make in order to solve the problem?

Because getDeviceInfoWithID() in src/libs/actions/Device/index.ts#L53-L63 is already asynchronous (Promise<string>) and is the sole caller of getDeviceInfo() in the codebase, we can enrich the osVersion on Windows using navigator.userAgentData.getHighEntropyValues(['platformVersion']) without breaking any synchronous callers of getOSAndName() (such as isMobileSafariOnIos26 in src/libs/Browser/index.web.ts#L70-L72):

  1. Extend the global Navigator type in src/types/modules/navigator.d.ts:

    export {};
    
    type NavigatorUAData = {
        platform?: string;
        getHighEntropyValues?: (hints: string[]) => Promise<{
            platformVersion?: string;
        }>;
    };
    
    declare global {
        interface Navigator {
            standalone?: boolean;
            userAgentData?: NavigatorUAData;
        }
    }
    
  2. Update OSAndName in src/libs/actions/Device/getDeviceInfo/getOSAndName/types.ts to match the shape returned by expensify-common (os and deviceVersion):

    type GetOSAndName = () => OSAndName;
    type OSAndName = {
        os?: string;
        osVersion?: string;
        deviceName?: string;
        deviceVersion?: string;
    };
    
    export type {GetOSAndName, OSAndName};
    
  3. Resolve Windows 11 osVersion via navigator.userAgentData.getHighEntropyValues(['platformVersion']) in src/libs/actions/Device/index.ts#L53-L63:

    const WINDOWS_11_MIN_PLATFORM_MAJOR_VERSION = 13;
    
    function getResolvedOSVersion(deviceInfo: ReturnType<typeof getDeviceInfo>): Promise<string | undefined> {
        if (deviceInfo.os !== 'Windows' || deviceInfo.osVersion !== '10' || typeof navigator === 'undefined' || !navigator.userAgentData?.getHighEntropyValues) {
            return Promise.resolve(deviceInfo.osVersion);
        }
    
        return navigator.userAgentData
            .getHighEntropyValues(['platformVersion'])
            .then(({platformVersion}) => {
                const majorVersion = Number(platformVersion?.split('.')[0]);
                if (!Number.isNaN(majorVersion) && majorVersion >= WINDOWS_11_MIN_PLATFORM_MAJOR_VERSION) {
                    return '11';
                }
                return deviceInfo.osVersion;
            })
            .catch(() => deviceInfo.osVersion);
    }
    
    /**
     * Returns a string object with device info and uniqueID
     */
    function getDeviceInfoWithID(): Promise<string> {
        const deviceInfo = getDeviceInfo();
        return Promise.all([getDeviceID(), getResolvedOSVersion(deviceInfo)]).then(([currentDeviceID, osVersion]) =>
            JSON.stringify({
                ...deviceInfo,
                osVersion,
                deviceID: currentDeviceID,
            }),
        );
    }
    

What alternative solutions did you explore? (Optional)

  • Making getOSAndName() or getDeviceInfo() return a Promise: getOSAndName() is called synchronously in isMobileSafariOnIos26 (src/libs/Browser/index.web.ts#L71). Resolving the high-entropy platformVersion inside getDeviceInfoWithID() (which already returns Promise<string>) avoids changing synchronous call sites while ensuring BeginSignIn / SignInUser send osVersion: "11" on Windows 11.
  • Note on Firefox / Safari: Firefox does not implement navigator.userAgentData and also freezes Windows NT 10.0 in navigator.userAgent with no web platform API to distinguish Windows 11, so the .catch() / feature-detection fallback safely preserves deviceInfo.osVersion ("10").

xian96xx avatar Oct 25 '26 14:10 xian96xx

📣 @xian96xx! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Oct 25 '26 14:10 melvin-bot[bot]

@mananjadhav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Oct 26 '26 21:10 melvin-bot[bot]

@mananjadhav Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Oct 28 '26 21:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~015ef940ed32e0c10f

xian96xx avatar Oct 29 '26 02:10 xian96xx

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 29 '26 02:10 melvin-bot[bot]

@mananjadhav Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] avatar Oct 30 '26 21:10 melvin-bot[bot]

@MelvinBot implement this

mananjadhav avatar Oct 30 '26 22:10 mananjadhav