Repository navigation
fix(reports): keep expense preview message consistent after reconnect… - #81544
JmillsExpensify merged 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3718b777b
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const hasViolationsAndFieldErrors = violationsCount > 0 && hasFieldErrors; | ||
|
|
||
| return isTooLong || hasViolationsAndHold || hasViolationsAndFieldErrors ? {translationPath: 'violations.reviewRequired'} : {text: violationMessage}; | ||
| return isTooLong || hasViolationsAndHold || hasViolationsAndFieldErrors || isTransactionOnHold ? {translationPath: 'violations.reviewRequired'} : {text: violationMessage}; |
There was a problem hiding this comment.
Preserve hold-specific preview message
Because getViolationTranslatePath now returns violations.reviewRequired whenever isTransactionOnHold is true, this value will overwrite the earlier iou.expenseWasPutOnHold message even when there are no violations or field errors. In that common “held, otherwise clean” case the preview used to show a specific hold message, but now always shows the generic “Review required,” which is a behavior regression and can confuse users about why the expense is blocked.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is not a behavior regression.
When a transaction is held, a HOLD violation is always added (see putOnHold in IOU.ts). So when data is fresh, hasViolationsAndHold is already true and "Review Required" is shown.
The "Expense was put on hold" message only appears due to the bug being fixed - when violations data is missing from stale snapshot. The issue explicitly states "Review Required" is the expected message in this scenario.
This fix simply ensures offline behavior matches online behavior:
- Online (fresh data):
hasViolationsAndHold = true→ "Review Required" - Offline (stale snapshot):
isTransactionOnHold = true→ "Review Required" (fixed)
No "held, otherwise clean" case exists by design - holding always creates a HOLD violation.
|
@Ollyws, kindly bump. thanks. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp01_Android_Native.mp4Android: mWeb Chrome02_Android_Chrome.mp4iOS: HybridApp03_iOS_Native.mp4iOS: mWeb Safari04_iOS_Safari.mp4MacOS: Chrome / Safari05_MacOS_Chrome.mp4 |
| function MarkdownTextInput({ref, parser, markdownStyle, formatSelection, ...textInputProps}: MarkdownTextInputProps) { | ||
| if (parser || markdownStyle || formatSelection) { | ||
| // no-op to mark unsupported mock props as used | ||
| } |
There was a problem hiding this comment.
NAB, seems kind of weird. Is there no ignore rule we can add instead?
There was a problem hiding this comment.
Curious, 'if' statement body is empty...
miss right?
There was a problem hiding this comment.
I was investigating something and saw this code, I am totally confused why lint didn't fail, no warning from AI reviews....
|
Approved. Pending @JmillsExpensify review. |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Looks good to me!
|
All checks pass, so merging this one since I'm last up. |
|
🚧 @JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Whoops, copied the wrong PR ID. Disregard |
|
🚀 Deployed to staging by https://github.com/JmillsExpensify in version: 9.3.19-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.19-5 🚀
|
Explanation of Change
Fixed Issues
$ #72845
PROPOSAL: #72845 (comment)
Tests
Prerequisite: Account has at least one workspace.
Reports > Chats.Reports > Chats.Reports > Chats.online/offlinein both chat andReports > Chats.Offline tests
Same as the test.
QA Steps
Same as the test.
// TODO: These must be filled out, or the issue title must include "[No QA]."
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.native.mp4
Android: mWeb Chrome
android.web.mp4
iOS: Native
iosnative.mp4
iOS: mWeb Safari
iosweb.mp4
MacOS: Chrome / Safari
web.mp4