fix: derive currentReceipt from page to fix wrong receipt deletion#79965
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
trjExpensify
left a comment
There was a problem hiding this comment.
I was on the parent issue for this one! 👍
|
@MobileMage can you check the eslint failure please? friendly bump @suneox for review |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-01-23.at.01.03.09.mp4Android: mWeb ChromeCleanShot.2026-01-23.at.00.56.49.mp4iOS: HybridAppCleanShot.2026-01-23.at.00.59.17.mp4iOS: mWeb SafariCleanShot.2026-01-23.at.00.54.49.mp4MacOS: Chrome / SafariCleanShot.2026-01-23.at.00.52.13.mp4 |
|
Overall, the change set looks good. We’re just waiting for @MobileMage to merge the latest main to resolve the ESLint issue. |
In the multi-scan flow, navigating between receipts with carousel arrows would update the page index but not the currentReceipt state, causing the delete action to remove the originally opened receipt instead of the currently viewed one. This change derives currentReceipt directly from the page index instead of storing it as separate state, ensuring it always reflects the currently displayed receipt.
6c742ed to
46d3a81
Compare
|
🚧 @rlinoz 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/rlinoz in version: 9.3.8-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.8-3 🚀
|
Explanation of Change
In the Money Requests multi-scan flow, the
ReceiptViewcomponent maintained two pieces of state that should stay in sync but didn't:page- the current carousel index, updated when user navigates via arrowscurrentReceipt- the receipt object used for deletionThe
currentReceiptwas only updated via auseEffectthat depended onroute.params.transactionID, which doesn't change during carousel navigation. This caused the delete action to remove the originally opened receipt instead of the currently viewed one.This fix derives
currentReceiptdirectly from thepageindex instead of storing it as separate state, ensuring it always reflects the currently displayed receipt.Fixed Issues
$ #79304
PROPOSAL:
Tests
Offline tests
N/A - This flow requires camera/receipt capture which doesn't function offline.
QA Steps
Same as tests.
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
79304-android-native.mp4
Android: mWeb Chrome
79304-android-mweb.mp4
iOS: Native
79304-ios-native.mov
iOS: mWeb Safari
79304-ios-mweb.mov
MacOS: Chrome / Safari
79304-desktop-web.mp4