Skip to content

[$250] Update required screen shown on latest iOS staging build after stale NewDot bundle sends outdated appversion #95258

Closed

Description

@mountiny

If you haven't already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.4.25-1 (native shell) / stale NewDot bundle 9.3.91-0
Reproducible in staging?: Needs Reproduction (Unable to reproduce — single isolated server-side event)
Reproducible in production?: Needs Reproduction
If this was caught during regression testing, add the test name, ID and link from BrowserStack:
Email or phone of affected tester (no customers): cole@expensify.com
Logs: VictoriaLogs investigation — request_id a143bbd4a9ef3335-SJC on 2026-07-01T07:35:23Z
Expensify/Expensify Issue URL:
Issue reported by: @vit (internal investigation)
Slack conversation: #Expensify Bugs — cole reported 2026-07-02 ~4:39 PM

Action Performed:

  1. Open the iOS native app on the latest TestFlight staging build
  2. Use the app normally (background/resume)
  3. Observe the full-screen Update required blocker

Expected Result:

Users on the latest staging build should never see the forced-update screen.

Actual Result:

cole@expensify.com saw the Update required / Please update to the latest version of New Expensify screen on iOS native TestFlight while already on the latest staging build. Hard-quitting the app cleared the screen and the app worked normally afterward.

Workaround:

Force-quit and reopen the app.

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Issue observed in the following devices

  • iOS (TestFlight staging)
  • Native shell: Expensify/9.4.25.1 CFNetwork/3860.600.12 Darwin/25.5.0
  • Screenshot attached in Slack thread (IMG_3948.PNG)

Screenshots/Videos

See Slack thread screenshot — full-screen Update Required blocker with green Update button.


Investigation summary (for implementers)

What triggered the screen

The forced-update UI is shown when any authenticated API returns jsonCode: 426:

  1. Backend (Web-Expensify/lib/Request.php) compares appversion param against MINIMUM_APP_VERSION (9.4.9 at time of incident)
  2. Frontend (App/src/libs/HttpUtils.ts) calls alertUser() → sets ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED
  3. App/src/Expensify.tsx throws CONST.ERROR.UPDATE_REQUIRED → error boundary renders App/src/pages/ErrorPage/UpdateRequiredView.tsx

The flag is RAM-only (App/src/setup/index.ts ramOnlyKeys) and is never cleared in-session — only a process restart resets it. That explains the self-recovery after hard-quit.

Server logs for cole@expensify.com (2026-07-01)

Exactly one request triggered the 426 across the entire Jun 15 – Jul 3 window:

Field Value
Timestamp 2026-07-01T07:35:23Z
request_id a143bbd4a9ef3335-SJC
command ReconnectApp
platform ios
referer ecash
appversion in request body 9.3.91-0
nginx User-Agent (native shell) Expensify/9.4.25.1
minimum at time 9.4.9
needsUpgrade true
jsonCode 426

Log sequence:

[ForceAppUpgrade] Comparing app version to minimum ~~ appVersion: '9.3.91-0' minimum: '9.4.9' needsUpgrade: '1'
Deprecated app version detected - forcing the user to upgrade
API threw ExpError ... exceptionJsonCode: '426'

All other cole requests that day used current versions (ecash9.4.24-0, ecash9.4.25-1, iphone9.4.25-1). The stale ecash9.3.91-0 source appeared once total.

Root cause hypothesis

The iOS HybridApp ran a stale NewDot JS bundle (9.3.91-0) inside a current native shell (9.4.25.1). The appversion sent on API calls comes from bundled package.json (App/src/libs/Network/enhanceParameters.ts → appversion: pkg.version), so it reflected the old JS bundle, not the native binary version.

On app resume, ReconnectApp fired with the stale version → backend correctly returned 426 → client stuck on Update Required until restart loaded a fresh bundle.

Open question for implementer: How did HybridApp retain/serve bundle 9.3.91-0 after a TestFlight update to 9.4.25? Investigate bundle loading, OTA update, and cache invalidation in Mobile-Expensify / @expensify/react-native-hybrid-app.

What this is NOT

  • Not a backend false positive — version_compare('9.3.91-0', '9.4.9', '<') is correct
  • Not cole running an actually outdated build — native User-Agent confirms 9.4.25.1
  • Not related to the recent minimum-version bump logic being wrong — the stale bundle predates the bump

Proposed fix direction

  1. Investigate HybridApp bundle lifecycle — ensure NewDot JS bundle version always matches or is invalidated when native app updates (TestFlight/OTA)
  2. Add defensive logging — when native shell version ≠ bundled pkg.version, log/Sentry so future occurrences are diagnosable
  3. (Optional follow-up, separate issue) — auto-recover from transient 426 if subsequent requests succeed with current version

Key files

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

Activity

  1. added
    External
    Bug
    on Jul 3, 2026
  2. added
    Help Wanted
    on Jul 3, 2026
  3. melvin-bot commented on Jul 3, 2026

    @melvin-bot

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

  4. changed the title [-]Update required screen shown on latest iOS staging build after stale NewDot bundle sends outdated appversion[/-] [+][$250] Update required screen shown on latest iOS staging build after stale NewDot bundle sends outdated appversion[/+] on Jul 3, 2026
  5. melvin-bot commented on Jul 3, 2026

    @melvin-bot
  6. kitvasyl commented on Jul 3, 2026

    @kitvasyl

    Proposal

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

    A current iOS TestFlight build can incorrectly show the blocking Update Required screen when a stale NewDot JavaScript bundle sends its bundled version to the API.

    What is the root cause of that problem?

    src/libs/Network/enhanceParameters.ts always sets appversion from package.json. In HybridApp, that value describes the loaded JavaScript bundle rather than the installed native shell. Therefore, a stale bundle can send an outdated version, receive a 426 response, and trigger alertUser() in src/libs/HttpUtils.ts even though the native app is current.

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

    Add a platform-specific app-version helper and use it in enhanceParameters(). Its native implementation should return DeviceInfo.getVersion() from react-native-device-info, while the web implementation should continue returning package.json's version. This ensures native requests report the installed binary version used to determine whether an App Store/TestFlight update is required, regardless of which embedded JS bundle is currently loaded.

    Add focused tests confirming that enhanceParameters() uses the native shell version on native platforms and retains the package version on web.

    What alternative solutions did you explore? (Optional)

    Clearing or ignoring the update-required flag after a 426 would hide this incident, but it would also allow genuinely unsupported native versions to bypass the required-update screen. Correcting the version sent by native requests addresses the false 426 without weakening that protection.

  7. shivang-goliyan commented on Jul 3, 2026

    @shivang-goliyan
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-07-03 07:00:53 UTC.

    Proposal

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

    A user on the latest iOS staging build got stuck on the full-screen "Update required" blocker even though they were already on the newest binary. Force-quitting and reopening cleared it. So the app is telling people to update when they don't need to, and once it happens they can't get out of it without killing the process.

    What is the root cause of that problem?

    There are two separate things going on here, and it helps to split them.

    First, why the 426 fired at all. Every API request tags on appversion: pkg.version in getBaseRequestParameters at src/libs/Network/enhanceParameters.ts:72, where pkg is the bundled package.json (line 10). That is the JS bundle's version, not the native binary version. In this incident the native shell was current (User-Agent Expensify/9.4.25.1) but the running NewDot JS bundle was stale (9.3.91-0), so ReconnectApp advertised the old version and the backend correctly returned 426. The backend was right. The request just carried a version that didn't match the shell it was running in. Why a stale bundle survived the TestFlight update is a HybridApp bundle-lifecycle question (OTA / cache invalidation) that lives in Mobile-Expensify and @expensify/react-native-hybrid-app, not in this repo.

    Second, and this is the part the App repo owns: once that 426 lands, the session can never recover on its own. HttpUtils.ts:197 calls alertUser() on JSON_CODE.UPDATE_REQUIRED, which does a single Onyx.set(RAM_ONLY_UPDATE_REQUIRED, true) in src/libs/actions/UpdateRequired.ts:6. Expensify.tsx:65 reads that flag and throws CONST.ERROR.UPDATE_REQUIRED, and the error boundary renders UpdateRequiredView. I grepped every reference to RAM_ONLY_UPDATE_REQUIRED and nothing anywhere sets it back to false. It's a RAM-only key (src/setup/index.ts:70), so the only thing that clears it is a process restart. That's exactly the "hard-quit fixes it" behavior in the report. A single stale/transient 426 permanently bricks the session until the app is killed, even after later requests go out with a perfectly current version.

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

    The bundle-serving cause is native and should be tracked in Mobile-Expensify. What we can fix on the App side is the stuck-forever behavior and the blind spot that made this hard to diagnose.

    Clear RAM_ONLY_UPDATE_REQUIRED when a later authenticated request comes back healthy with a current version. Add a small clearAlert() in UpdateRequired.ts that sets the flag back to false, and call it from the HttpUtils.ts response handler on the non-426 success path so a good response undoes a stale one. That turns a permanent block into a self-healing one without weakening the real forced-upgrade case, since a genuinely outdated client keeps getting 426 and the flag stays set.

    Alongside that, add defensive logging in enhanceParameters (or right before alertUser()): compare the native binary version from react-native-device-info DeviceInfo.getVersion() against bundled pkg.version, and log/Sentry when they diverge on HybridApp. We already use react-native-device-info elsewhere, so this is a small addition that would have named this exact mismatch immediately. Neither area has a test asserting 426 recovery today, so I'd add one covering set-then-clear on a subsequent successful request.

    What alternative solutions did you explore? (Optional)

    Fix it purely in Mobile-Expensify by never serving a stale bundle after a native update. That addresses the trigger but leaves the App session with no way to recover if any transient 426 ever slips through, so it's worth doing but not sufficient on its own. I also considered logging-only (the version-mismatch signal) with no recovery change, but that just makes the next occurrence diagnosable while still forcing every affected user to force-quit.

  8. nabi-ebrahimi commented on Jul 3, 2026

    @nabi-ebrahimi
    Contributor

    Proposal

    What is the root cause of that problem?

    The API appversion parameter is using the loaded NewDot JS bundle version instead of the installed native shell version. getBaseRequestParameters() always sends pkg.version for appversion, so a stale HybridApp bundle can report an old version even when the TestFlight binary is current ([source](https://github.com/Expensify/App/blob/main/src/libs/Network/enhanceParameters.ts#L60-L73)). Queued requests also seed request.data.appversion from the same JS package version ([source](https://github.com/Expensify/App/blob/main/src/libs/Network/index.ts#L49-L54)). When that stale value is below the backend minimum, the API returns jsonCode: 426; the client treats any 426 as update-required ([source](https://github.com/Expensify/App/blob/main/src/libs/HttpUtils.ts#L195-L198)), then Expensify reads RAM_ONLY_UPDATE_REQUIRED and throws the blocking update error ([source](https://github.com/Expensify/App/blob/main/src/Expensify.tsx#L65-L65), [source](https://github.com/Expensify/App/blob/main/src/Expensify.tsx#L281-L283)). That makes a current native app look outdated until the process restarts and the RAM-only flag is reset.

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

    Add a small platform-specific app-version helper and use it everywhere we populate the API appversion field. The default/web implementation should keep returning pkg.version. The native implementation should return the installed native app version, not the JS bundle version.

    For Android, the native version source can use DeviceInfo.getVersion() because Android’s versionName already matches the API/package format like 9.4.26-6 ([source](https://github.com/Expensify/App/blob/main/android/app/build.gradle#L114-L115)). For iOS, use the native bundle version and normalize it to the JS/API format by replacing the last dot with a hyphen, matching the existing native Sentry release formatting logic ([source](https://github.com/Expensify/App/blob/main/ios/SentryNativeSDKManager.m#L49-L54)); the iOS bundle currently stores CFBundleVersion as 9.4.26.6 while the API/package format is 9.4.26-6 ([source](https://github.com/Expensify/App/blob/main/ios/NewExpensify/Info.plist#L25-L47)).

    Then update getBaseRequestParameters() to set appversion from this helper instead of pkg.version, so every request enhanced through the normal network path reports the installed app version on native ([source](https://github.com/Expensify/App/blob/main/src/libs/Network/enhanceParameters.ts#L60-L80)). Also update the queued-request seed in Network.post() to use the same helper instead of pkg.version, so persisted/queued request data is consistent with the enhanced request metadata ([source](https://github.com/Expensify/App/blob/main/src/libs/Network/index.ts#L49-L54)). Finally, update the existing enhanceParameters unit coverage to mock the helper and assert that appversion comes from the helper rather than directly from package.json.

    What alternative solutions did you explore? (Optional)

    I considered clearing or ignoring RAM_ONLY_UPDATE_REQUIRED after a restart/resume, but that would weaken the valid forced-update flow for genuinely unsupported native builds. I also considered fixing only the HybridApp stale-bundle cache, but the App API layer would still trust the wrong source of truth whenever a stale bundle is loaded.

  9. samranahm commented on Jul 3, 2026

    @samranahm
    Contributor

    Proposal

    What is the root cause of that problem?

    On native HybridApp the version reported to the API describes the loaded JS bundle, not the installed native shell. In Network/index.ts every request hardcodes appversion: pkg.version:

    shouldRetry: data?.shouldRetry ?? true,
    canCancel: data?.canCancel ?? true,
    appversion: pkg.version,
    };
    // Add promise handlers to any request that we are not persisting

    pkg.version comes from the bundled package.json. When a stale NewDot bundle (9.3.91-0) runs inside a current shell (9.4.25.1), the reconnect request carries 9.3.91-0. The backend correctly compares that against MINIMUM_APP_VERSION and returns 426, so the client is punished for a version the user is not actually running.

    HttpUtils.ts then reacts to any 426 by unconditionally calling alertUser():

    App/src/libs/HttpUtils.ts

    Lines 195 to 199 in 3ad48ca

    if (response.jsonCode === CONST.JSON_CODE.UPDATE_REQUIRED) {
    // Trigger a modal and disable the app as the user needs to upgrade to the latest minimum version to continue
    alertUser();
    }
    return response;

    alertUser() sets RAM_ONLY_UPDATE_REQUIRED:

    function alertUser() {

    That key is RAM-only (setup/index.ts ramOnlyKeys), so it is never persisted and, more importantly, never cleared mid-session:

    App/src/setup/index.ts

    Lines 67 to 73 in 3ad48ca

    ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS,
    ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM,
    ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE,
    ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED,
    ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS,
    ONYXKEYS.RAM_ONLY_IS_AUTHENTICATING_WITH_SHORT_LIVED_TOKEN,
    ONYXKEYS.RAM_ONLY_WALLET_ONFIDO,

    Expensify.tsx reads the flag and keeps rendering the blocker until a process restart loads a fresh bundle, which is why hard-quit self-recovers:

    App/src/Expensify.tsx

    Lines 62 to 67 in 3ad48ca

    const {preferredLocale} = useLocalize();
    const [lastRoute] = useOnyx(ONYXKEYS.LAST_ROUTE);
    const [isCheckingPublicRoom = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM);
    const [updateRequired] = useOnyx(ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED);
    const [lastVisitedPath] = useOnyx(ONYXKEYS.LAST_VISITED_PATH);
    useDebugShortcut();

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

    1. Fix the version at its source in Network/index.ts so native requests report the installed shell version, not the bundle. The native device version is already collected by the platform-specific device info module (getDeviceInfo, BaseInfo):

    Add a small platform-specific getAppVersion (native reads react-native-device-info, web returns pkg.version) and use it where appversion is assembled:

    shouldRetry: data?.shouldRetry ?? true,
    canCancel: data?.canCancel ?? true,
    appversion: pkg.version,
    };
    // Add promise handlers to any request that we are not persisting

    appversion: getAppVersion(),

    Because the shell version stays current across bundle swaps, a stale JS bundle can no longer send an outdated appversion, so the backend stops returning a false 426.

    1. Add defensive logging in the 426 branch of HttpUtils.ts so any remaining occurrence is diagnosable, capturing the version actually sent alongside pkg.version:

    App/src/libs/HttpUtils.ts

    Lines 195 to 199 in 3ad48ca

    if (response.jsonCode === CONST.JSON_CODE.UPDATE_REQUIRED) {
    // Trigger a modal and disable the app as the user needs to upgrade to the latest minimum version to continue
    alertUser();
    }
    return response;

    if (response.jsonCode === CONST.JSON_CODE.UPDATE_REQUIRED) {
        Log.warn('[UpdateRequired] 426 received', {sentVersion: getAppVersion(), bundleVersion: pkg.version});
        alertUser();
    }

    This surfaces the shell-vs-bundle mismatch that caused this incident instead of silently blocking the user.

    What alternative solutions did you explore? (Optional)

    Before calling alertUser(), re-issue a single lightweight authenticated command and only trigger the blocker if it also returns 426. This confirms the version is genuinely below minimum and filters out a one-off transient reconnect, but it adds retry complexity and does not fix the wrong version being sent, so correcting the source version is preferable.

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  10. KJ21-ENG commented on Jul 3, 2026

    @KJ21-ENG
  11. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    ⚠️ @KJ21-ENG Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  12. added a commit that references this issue on Jul 3, 2026
  13. 23 remaining items

  14. mkhutornyi commented on Jul 13, 2026

    @mkhutornyi

    New nitro fetch PR is not merged yet

  15. mountiny commented on Jul 17, 2026

    @mountiny
    ContributorAuthor

    @chrispader have you been able to identify what from the native fetch pr caused this issue?

  16. melvin-bot commented on Jul 17, 2026

    @melvin-bot

    @chrispader @mountiny @staszekscp @mkhutornyi this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  17. melvin-bot commented on Jul 17, 2026

    @melvin-bot

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

  18. melvin-bot commented on Jul 21, 2026

    @melvin-bot

    @mkhutornyi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  19. chrispader commented on Jul 23, 2026

    @chrispader
    Contributor

    Addressed in #95518

  20. melvin-bot commented on Jul 23, 2026

    @melvin-bot

    @mkhutornyi Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  21. added
    Reviewing
    Weekly
    and removed
    Daily
    on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugExternalReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions