Conversation
…here isUpdateOld is true and the request did not provide any successData, failureData, or finallyData
51 tasks
tgolen
approved these changes
Feb 24, 2026
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
deetergp
approved these changes
Feb 25, 2026
Contributor
|
🚧 @deetergp has triggered a test Expensify/App build. You can view the workflow run here. |
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Contributor
|
🚀 Deployed to staging by https://github.com/deetergp in version: 9.3.26-0 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.26-8 🚀
|
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
OnyxUpdates.apply()has a code path for when a response'slastUpdateIDhas already been applied to the client (isUpdateOld). When the request includessuccessData/failureData/finallyData, it correctly strips the server's onyxData and applies the request's onyx updates, returning the response. But when the request has none of those, which is a common case formakeRequestWithSideEffectsas many callers only need the raw response, it was returningPromise.resolve(), which resolves toundefined.App/src/libs/actions/OnyxUpdates.ts
Line 203 in 436534c
This is becomes a problem under a race condition: if a Pusher update or a concurrent HTTP request advances
lastUpdateIDAppliedToClientwhile a side-effect request is in flight, the response may hit this codepath and the caller receivesundefinedinstead of the response it needs. Several existing callers are affected:AUTHENTICATE_PUSHER(Session/index.ts): No onyx data. An undefined response causesresponse?.jsonCode !== SUCCESSto be true, and the Pusher callback receives an error ("code: undefined message: undefined"). This could cause intermittent real-time update failures. Notably, the very mechanism that triggers Pusher re-auth (receiving Pusher updates) also advanceslastUpdateIDAppliedToClient, creating the conditions for the race.GET_SCIM_TOKEN(Domain.ts): No onyx data. Returns a generic error to the user instead of theSCIMtoken.CREATE_DIGITAL_WALLET(Wallet.ts): No onyx data. Apple Pay / Google Pay card provisioning would fail silently.GENERATE_SPOTNANA_TOKEN(Link.ts): Passes{}. Travel link opening throws becauseundefined?.spotnanaTokenis falsey.CONNECT_POLICY_TO_QUICKBOOKS_DESKTOP(QuickbooksDesktop.ts): No onyx data. Caller getsundefinedinstead of the Codat setup link.VERIFY_TEST_DRIVE_RECIPIENT(Onboarding.ts): No onyx data. Throws instead of checking account existence.MultifactorAuthentication(registerAuthenticationKey, requestAuthorizationChallenge, troubleshootMultifactorAuthentication): MFA operations fail with error status.This fix changes
Promise.resolve()toPromise.resolve(response)so the response is always propagated back to the caller, even when the Onyx update portion is correctly skipped as redundant.Fixed Issues
Relates to #79379
This change was cherry-picked from #82704, and is necessary for it to work reliably
Tests
npm run test -- OnyxUpdatesTest.tsand verify the new test 'preserves the response object when HTTPS update is old and request has no successData/failureData/finallyData' passesnpm run test -- MiddlewareTest.tsand verify the new test 'preserves the response for side-effect requests when the update is already applied' passesOffline tests
N/A
QA Steps
This is a race condition fix that is difficult to reproduce manually. The fix is validated by automated tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari