Use error message from server for scan failed receipts#87111
Use error message from server for scan failed receipts#87111MonilBhavsar wants to merge 2 commits intomainfrom
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@arosiclair 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15d5caaa84
ℹ️ 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".
| } | ||
| if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.RECEIPT_SCAN_FAILED) { | ||
| return translate('iou.receiptScanningFailed'); | ||
| return getReportActionMessageText(reportAction) ?? translate('iou.receiptScanningFailed'); |
There was a problem hiding this comment.
Treat empty scan-failure message as missing
getReportActionMessageText() returns a string and can legitimately return '' when the action has no usable message content, so ?? does not trigger the fallback in that case. For RECEIPT_SCAN_FAILED actions with empty server text, this path returns an empty message instead of translate('iou.receiptScanningFailed'), causing blank system text in the UI; the same nullish-only fallback pattern was introduced in the other two touched files as well.
Useful? React with 👍 / 👎.
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Nice, excited for this!
Explanation of Change
Display error message from server. Fallback to default generic message
Fixed Issues
Part of https://github.com/Expensify/Expensify/issues/613984
PROPOSAL:
Tests
The new feature tests with Auth PR https://github.com/Expensify/Auth/pull/20814
Offline tests
QA Steps
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari