Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.5-2 (installed), previous session on 9.4.89-0
Reproducible in staging?: N/A
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: N/A
Email or phone of affected tester (no customers): N/A
Logs: See below
Expensify/Expensify Issue URL: N/A
Issue reported by: Customer report
Slack conversation (hyperlinked to channel name): N/A
Action Performed:
The issue was reported by the user. Not reproduced yet.
- On Android, use the app on a version that is now below the server's minimum (e.g.
9.4.89-0, minimum is9.5.1). This makes the app save itsReconnectApprequest for the next launch. - Close the app.
- Update the app from the Play Store to a version at or above the minimum (e.g.
9.5.5-2). - Open the app.
Expected Result:
The app opens normally. The installed version is above the minimum.
Actual Result:
The app shows the "Update Required" screen and can't be used, even though the installed version is current.
Workaround:
N/A
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
Screenshots/Videos
N/A
Root cause
On native, ReconnectApp is prefetched at startup with react-native-nitro-fetch: each JS ReconnectApp call saves its full request body for the next launch. That body comes from enhanceParameters, so it contains appversion from the build that saved it.
After an app update, the first launch sends that saved body before JS loads. It carries the previous build's appversion, so the server returns 426 Deprecated app version. The new JS bundle's own ReconnectApp is then answered from that cached response instead of going to the server. HttpUtils sees jsonCode: 426, calls alertUser(), and the app shows Update Required page.
What the logs show
One affected session, all within ~1 second of app launch:
| Command | appversion | Result |
|---|---|---|
ReconnectApp (prefetched) |
9.4.89-0 | 426 |
| OpenHomePage, Search, GetRules, Log | 9.5.5-2 | 200 |
Server log for the ReconnectApp request:
[ForceAppUpgrade] Comparing app version to minimum ~~ appVersion: '9.4.89-0' minimum: '9.5.1' needsUpgrade: '1'
Deprecated app version detected - forcing the user to upgrade
Profile ~~ {"cmd":"ReconnectApp","jsonCode":426}
Only ReconnectApp carried the old version. It also carried an older clientUpdateID than the requests that followed, which fits a request body saved in an earlier session.
How the code produces it
ReconnectAppis the only command prefetched on native.src/libs/Prefetch/PrefetchQueries/index.native.ts:6Request.tscallsenhanceParameters, which addsappversion: pkg.versionto the request body.src/libs/Request.ts:26,src/libs/Network/enhanceParameters.ts:73processHTTPRequestsaves that body for the next launch withregisterPrefetchOnAppStart, which callsprefetchOnAppStart(url, fetchParams).src/libs/HttpUtils.ts:94-107- At the next launch, nitro-fetch sends the saved body unchanged and adds only token headers.
react-native-nitro-fetch/android/.../AutoPrefetcher.kt:141-172, 223-232 - The JS request with the same
prefetchKeygets the pending or cached prefetch response.react-native-nitro-fetch/android/.../HybridNitroFetchClient.kt:502-521 - The 426 calls
alertUser(), which setsRAM_ONLY_UPDATE_REQUIREDand rendersUpdateRequiredView.src/libs/HttpUtils.ts:242-244,src/libs/actions/UpdateRequired/index.native.ts:6,src/Expensify.tsx:295-296
The startup token-refresh body already avoids this problem. buildAuthenticateBody leaves appversion out on purpose:
App/src/libs/Prefetch/registerPrefetchOnAppStart/index.ts
Lines 27 to 31 in 3faeb65
| // The `appversion` parameter is omitted intentionally here. | |
| // This is because it can cause issues during app updates and | |
| // it is not needed by the "Authenticate" command for token refresh. | |
| // eslint-disable-next-line @typescript-eslint/naming-convention | |
| const {referer, platform, api_setCookie, isFromDevEnv} = getBaseRequestParameters(); |
That only covers the Authenticate body. The saved ReconnectApp body is the JS request's FormData and still includes appversion.
Proposed solutions
- Remove
appversionfrom the savedReconnectAppbody, asbuildAuthenticateBodyalready does for Authenticate. - Clear saved prefetches when the app version changes: store the version that saved them and call
removeAllFromAutoprefetch()at startup if it doesn't matchpkg.version.
Issue Owner
Current Issue Owner: @mallenexpensifyIssue Owner
Current Issue Owner: @mallenexpensifyUpwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022109643316587728180
- Upwork Job ID: 2109643316587728180
- Last Price Increase: 2026-10-12
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
MelvinBot commentedon Oct 12, 2026
Proposal
What is the root cause of that problem?
I checked the code, and the root cause in the issue holds. On every JS
ReconnectAppcall,registerPrefetchOnAppStartsaves the request's fullFormDatato the nitro-fetch startup queue. That body includes theappversionthatenhanceParametersadded.After an update, the native side resends that saved body before JS loads. It only swaps in a fresh
authToken, so the oldappversiongoes out and the server returns 426. The new JSReconnectAppuses the same key,ReconnectApp:<accountID>, so it receives that 426. ThenHttpUtilscallsalertUser().Only
Authenticatewas fixed for this.buildAuthenticateBodyleaves outappversion, but the savedReconnectAppbody still includes it.What changes do you think we should make in order to solve the problem?
In
registerPrefetchOnAppStart, removeappversionfrom the saved copy of the body before callingprefetchOnAppStart:FormDatafromfetchParams.body.getParts(), skipping theappversionfield.{...fetchParams, body: strippedBody}toprefetchOnAppStart.The live JS request at
HttpUtils.ts:118still sendsappversion, so the server still enforces the minimum version on every normal request. This follows the approach already used forAuthenticate.Add a unit test: register a
ReconnectAppprefetch and assert the saved body has noappversionwhile its other fields stay unchanged.What alternative solutions did you explore? (Optional)
pkg.versionto the prefetch key inpreparePrefetchRequestand clear entries saved under old keys. A response requested by an old build then never reaches a new build. The cost is no prefetch benefit on the first launch after each update.removeAllFromAutoprefetchclears only the saved queue, not the pending or cached response. A real fix this way needs a native patch to nitro-fetch.Investigation details
ReconnectAppsaves a fresh body before it sends (HttpUtils.ts:107), so the next launch recovers.clearPrefetchOnAppStartruns only on sign-out, account switch, full reconnect, and token updates.react-native-nitro-fetch(V4). Removingappversionfrom the token-refresh body came out of [$250] Update required screen shown on latest iOS staging build after stale NewDot bundle sends outdated appversion, which reported this same symptom. That fix covered onlyAuthenticate. iOS uses the same JS registration path, so it is likely affected too. I haven't verified the iOS native code.ReconnectAppwithoutappversion, as it already does forAuthenticate. I couldn't check that here.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/103764)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Oct 12, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)[-][Android] "Update Required" shown after updating the app because the startup ReconnectApp prefetch sends the old `appversion`[/-][+][$175] [Android] "Update Required" shown after updating the app because the startup ReconnectApp prefetch sends the old `appversion`[/+]melvin-bot commentedon Oct 12, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022109643316587728180
taieddie commentedon Oct 12, 2026
Contributor details
Your Expensify account email: taieddie8@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01af851c9a7f771775
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, after updating the Expensify app from an older build (below the server's minimum version) to a new build at or above the minimum version, the app displays the "Update Required" screen on the first launch, blocking the user even though the installed version is current.
What is the root cause of that problem?
The root cause is that the
ReconnectAppstartup prefetch serializes and persists the old build'sappversionacross updates:src/libs/HttpUtils.ts, every time aReconnectApprequest is processed,registerPrefetchOnAppStartreceivesfetchParamswith aFormDatabody populated byenhanceParameters. This body containsappversion: pkg.versionof the currently running session.src/libs/Prefetch/registerPrefetchOnAppStart/index.ts,registerPrefetchOnAppStartcallsprefetchOnAppStart(url, fetchParams)without strippingappversion.react-native-nitro-fetchmodule fires the savedReconnectApprequest at app startup before JavaScript finishes loading. Native only refreshes auth token headers, sending the previously saved body carrying the oldappversion.appversionagainst the minimum version and returns HTTP 426 (Deprecated app version).ReconnectApp, it hits the cached or in-flight native prefetch with matching prefetchKeyReconnectApp:<accountID>, receiving the 426 response.HttpUtilsseesjsonCode: 426and callsalertUser(), rendering theUpdateRequiredView.While
buildAuthenticateBodyinregisterPrefetchOnAppStart/index.tsalready deliberately omitsappversionfor this exact reason (as documented in lines 27-29),registerPrefetchOnAppStartcurrently passes the fullReconnectAppfetchParams.bodycontainingappversionintoprefetchOnAppStart.What changes do you think we should make in order to solve the problem?
In
src/libs/Prefetch/registerPrefetchOnAppStart/index.ts:registerPrefetchOnAppStart, stripappversionfrom the request body before passing it toprefetchOnAppStart.FormDatawithout mutating the originalfetchParams.body(ensuring the live JavaScript request atHttpUtils.ts:118continues to sendappversionfor normal version checks):fetchParams.body(usinggetParts()on React Native or iteratingFormData), filter out theappversionfield, and build astrippedBody.{...fetchParams, body: strippedBody}toprefetchOnAppStart(url, fetchParamsWithStrippedBody).ReconnectAppwithbuildAuthenticateBody, ensuring startup prefetches never lock users out with a stale version string after app upgrades.In automated unit tests:
tests/unit/registerPrefetchOnAppStartTest.ts:registerPrefetchOnAppStartis called with afetchParams.bodycontainingappversion,prefetchOnAppStartis invoked with a body that hasappversionremoved.clientUpdateIDor account identifiers) remain preserved.fetchParams.bodypassed byHttpUtilsis not mutated.What alternative solutions did you explore? (Optional)
I explored appending the active
pkg.versiontoprefetchKeyinpreparePrefetchRequestso that a new build's JS bundle never matches a prefetch response initiated by an older build. However, strippingappversiondirectly inregisterPrefetchOnAppStartis cleaner and directly matches the existing architectural precedent established bybuildAuthenticateBody.melvin-bot commentedon Oct 12, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
jloa-dev commentedon Oct 12, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, updating the app from the Play Store causes the app to get stuck on the "Update Required" modal on first launch after update, despite the installed build version being current and above the server's minimum requirement.
What is the root cause of that problem?
On native platforms,
ReconnectAppis prefetched at startup viareact-native-nitro-fetch. Each JSReconnectAppcall saves its full request body viaregisterPrefetchOnAppStart(src/libs/HttpUtils.ts:107). Because the body originates fromenhanceParameters, it serializesappversion: pkg.versionof the build that executed the previous session.When the user updates the app via the Play Store and launches it:
ReconnectAppbody before JS initializes.appversion.426 Deprecated app version.ReconnectAppdirectly from the cached prefetch response, triggeringalertUser()and showing the blocking "Update Required" modal.Notably,
buildAuthenticateBodyinregisterPrefetchOnAppStart/index.ts:27-29already notes this exact risk and omitsappversionon purpose:However, this sanitization was never applied to the prefetched
ReconnectAppbody itself.What changes do you think we should make in order to solve the problem?
In
src/libs/Prefetch/registerPrefetchOnAppStart/index.ts:Sanitize
fetchParams.bodybefore passing toprefetchOnAppStartby strippingappversion, matching the established invariant inbuildAuthenticateBody:When the app launches after an update, the prefetch request goes through without the stale version parameter, and once JS loads, the active session uses the fresh
pkg.version.What alternative solutions did you explore? (Optional)
removeAllFromAutoprefetch()when a version mismatch is detected: This discards the cache and defeats the performance benefit of startup prefetching on the critical first launch. Omittingappversionlets the prefetch succeed cleanly.What specific scenarios should we cover in automated tests?
In
tests/unit/registerPrefetchOnAppStartTest.ts:registerPrefetchOnAppStartstripsappversionfrom FormData when dispatchingprefetchOnAppStart.Contributor details
Your Expensify account email: jloa.dev@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa
15 remaining items
melvin-bot commentedon Oct 22, 2026
@eVoloshchak 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
VickyStash commentedon Oct 23, 2026
Not overdue, the solution was deployed to production
melvin-bot commentedon Oct 25, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 25, 2026
Payment Summary
Resolving PRs:
Skip
appversionfrom the ReconnectApp startup prefetch body #103842Reviewer: @eVoloshchak owed $175 via NewDot
Contributor: @VickyStash does not require payment (Contractor)
BugZero Checklist (@mallenexpensify)
eVoloshchak commentedon Oct 26, 2026
Contributor+ Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: https://expensify.slack.com/archives/C01GTK53T8Q/p1793027098524869
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Do we agree 👍 or 👎
eVoloshchak commentedon Oct 26, 2026
This wasn't caused by #103842
#104286 (comment)
mallenexpensify commentedon Oct 27, 2026
Payment Summary
Contributor+: @eVoloshchak due $175 via NewDot
JmillsExpensify commentedon Nov 10, 2026
$175 approved for @eVoloshchak