fix: Confirm page shows Amount field with 0.00 amount when receipt is scanning v2#82672
Conversation
…h 0.00 amount when receipt is scanning""
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.
|
|
@brunovjk Should we update the receipt status when editing the draft transaction like we did when updating the field of scan transaction. The current problem with the regression is that the receipt's state isn't updated when the amount is edited, and the merchant is still empty, so App/src/libs/TransactionUtils/index.ts Lines 835 to 845 in 3a0446b |
|
@brunovjk Friendly bump. |
|
Thanks for the bump, I'll review it ASAP. If not today, then tomorrow morning. |
|
Sorry for the delay. @nkdengineer, can you confirm if I understood correctly? You want to get back with our original PR and then create another one to update the receipt's status? Thank you. |
|
I'm asking you to share your thought about this solution before implementing it. |
|
Sorry for the delay @nkdengineer, yes your approach makes sense to me, I don't see any downsides right now, implement what you think and I'll review/test it more carefully, is that ok? Thank you. |
|
@brunovjk This is ready for review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d5ab200ed
ℹ️ 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".
| if (!isDraft) { | ||
| return; | ||
| } | ||
| Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {receipt: {state: CONST.IOU.RECEIPT_STATE.OPEN}}); |
There was a problem hiding this comment.
Only mark receipt OPEN when a receipt exists
setMoneyRequestReceiptState() now unconditionally writes receipt.state = OPEN for every draft update, so non-scan drafts (for example from IOURequestStepAmount) are treated as if they already have a receipt even when no file was attached. Because hasReceipt() returns true whenever receipt.state is present, downstream checks that rely on !hasReceipt(...) (including receipt-required violation logic in ViolationsUtils) can be skipped, which can hide required-receipt enforcement for control policies after simple edits like amount/merchant/date.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@nkdengineer what do you think of this comment? I ran some tests and didn't find any regressions.
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp82672_android_native.movAndroid: mWeb ChromeUploading 82672_android_web.mov… iOS: HybridAppiOS: mWeb SafariUploading 82672_ios_web.mov… MacOS: Chrome / SafariUploading 82672_web_chrome.mov… |
|
@nkdengineer do you think the "Jest Unit Tests" warnings are related to our PR? Also could you update the PR title? No rush. Thanks. |
|
@brunovjk I updated. |
|
🚧 @tylerkaraszewski 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. |
|
🚀 Deployed to staging by https://github.com/tylerkaraszewski in version: 9.3.37-0 🚀
|
|
Deploy Blocker #83706 was identified to be related to this PR. |
|
Deploy Blocker ##85152 was identified to be related to this PR. |
|
Reverting this PR due to this issue This is a recommendation from AI:
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.37-10 🚀
|
Explanation of Change
fix: Confirm page shows Amount field with 0.00 amount when receipt is scanning
Fixed Issues
$ #80287
PROPOSAL: #80287 (comment)
Tests
scanning...text.Offline tests
Same
QA Steps
Same as test
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
Screen.Recording.2026-02-02.at.16.39.18.mov
Android: mWeb Chrome
Screen.Recording.2026-02-02.at.16.35.44.mov
iOS: Native
Screen.Recording.2026-02-02.at.16.45.24.mov
iOS: mWeb Safari
Screen.Recording.2026-02-02.at.16.41.00.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-02.at.16.34.25.mov
Screen.Recording.2026-03-03.at.21.52.35.mov