Fix next step showing 'an admin' instead of 'you' after approval#81998
Fix next step showing 'an admin' instead of 'you' after approval#81998MobileMage wants to merge 1 commit intoExpensify:mainfrom
Conversation
|
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed5bcc71f8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| <View style={[styles.flexRow, styles.gap2, styles.justifyContentStart, styles.flexNoWrap, styles.ph5, styles.pb3]}> | ||
| <View style={[styles.flexShrink1, styles.flexGrow1, styles.mnw0, styles.flexWrap, styles.justifyContentCenter]}> | ||
| {showNextStepBar && <MoneyReportHeaderStatusBar nextStep={effectiveNextStep} />} | ||
| {showNextStepBar && <MoneyReportHeaderStatusBar nextStep={optimisticNextStep} />} |
There was a problem hiding this comment.
Restore fallback to canonical report nextStep
This change always renders optimisticNextStep, which comes from the deprecated reportNextStep_ collection, but those two next-step sources are not always rolled back together. For example, in setReportField we optimistically write both (src/libs/actions/Report/index.ts around 2725–2743) and on failure only restore report.nextStep (.../Report/index.ts 2775–2791), leaving reportNextStep_ stale; with this header change, a failed optimistic update can keep showing outdated next-step text instead of the corrected server state. The previous effectiveNextStep fallback prevented that by using moneyRequestReport.nextStep whenever there was no explicit local override.
Useful? React with 👍 / 👎.
Revert the effectiveNextStep logic from Expensify#80715 that incorrectly preferred the server's nextStep over the optimistic one after approval, causing the status bar to show "Waiting for an admin to pay" instead of "Waiting for you to pay". Fixes Expensify#81967
ed5bcc7 to
8f77bd0
Compare
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-02-10.at.4.33.01.pm.mov |
|
I can confirm that the changes in |
8f77bd0 to
4819f46
Compare
|
Sorry, that was a mistake, I'll undo the force push |
4819f46 to
8f77bd0
Compare
|
@MobileMage in the future, don't force push once review started. |
|
@MobileMage please close this PR. No longer needed. |
Explanation of Change
PR #80715 introduced
effectiveNextSteplogic that chose between the optimistic (client-computed) next step and the server'snextStepbased on ahasOptimisticOverridecheck. After approval,optimisticNextStep === nextStep(no override), so it fell through tomoneyRequestReport?.nextStepfrom the server, which contains generic "an admin" text instead of the personalized "you" message. This PR reverts that logic so the status bar always uses the client-computed optimistic next step, which correctly personalizes the actor.Fixed Issues
$ #81967
Tests
Offline tests
QA Steps
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
81967.mp4