Fix incorrect first-submit next-step approver#90877
Open
emkhalid wants to merge 3 commits into
Open
Conversation
joekaufmanexpensify
approved these changes
May 18, 2026
Contributor
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Steps make sense to me
Contributor
|
Sorry for the delay. I have some priority PRs to review. I will review this one tomorrow. Could you merge the latest main? @emkhalid |
Contributor
|
@emkhalid please merge the latest main |
Contributor
Author
|
@dmkt9 sorry for the delay, I merged the main |
Contributor
Contributor
Author
|
@dmkt9 gentle bump, thanks |
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
This PR fixes the first optimistic next-step approver shown after submitting an expense report with approval rules.
The approval routing already calculates the correct submit target via
getSubmitToAccountID(), butgetNextApproverAccountID()preferred the stalereport.managerIDwhenisUnapprovedwas true. During the first optimistic submit,report.managerIDcan still point to the previous/default approver, so the UI showed the wrong approver until backend data corrected it.This change makes
getNextApproverAccountID()prefer a validsubmitToAccountIDand only fall back toreport.managerIDwhen the submit target is invalid.Fixed Issues
$ #88788
PROPOSAL: #88788 (comment)
Tests
Travel.Travel -> User C.Travel.Offline tests
Travel.QA Steps
Same as tests and offline tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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-native-approver-fix.mp4
Android: mWeb Chrome
android-web-approver-fix.mp4
iOS: Native
ios-native-approver-fix.mp4
iOS: mWeb Safari
ios-web-approver-fix.mp4
MacOS: Chrome / Safari
macos-approver-fix.mp4