-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP Staging] Fix existing expense is removed when dismissing receipt error #44364
[CP Staging] Fix existing expense is removed when dismissing receipt error #44364
Conversation
@@ -798,7 +798,6 @@ function buildOnyxDataForMoneyRequest( | |||
// Disabling this line since transaction.filename can be an empty string | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | |||
errors: getReceiptError(transaction.receipt, transaction.filename || transaction.receipt?.filename, isScanRequest, errorKey), | |||
pendingAction: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't clear the pending action when fails, otherwise, we don't have the information on whether the action is new or not. That's the pattern we use, for example, when adding a comment/message.
Additional video showing the transaction is deleted when it's a new transaction.
Screen.Recording.2024-06-25.at.11.40.38.mov
c086679
to
3c6bd13
Compare
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-06-25_12.39.00.mp4Android: mWeb Chromeandroid-chrome-2024-06-25_12.42.43.mp4iOS: NativeiOS: mWeb SafariMacOS: Chrome / Safaridesktop-chrome-2024-06-25_11.27.42.mp4MacOS: Desktopdesktop-app-2024-06-25_12.34.00.mp4 |
@bernhardoj It's maybe not within the scope of this PR, but is it easy enough to also clear the receipt placeholder image when clearing the error? This would make things more in line with what happens if you go in and delete a receipt from a money request (i.e. it resets completely back to a manual request). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I see that when we edit the receipt, it will revert back to the old receipt with the help of failureData. Lines 6649 to 6654 in 0bcd005
However, in case the old receipt is empty, merging an empty object to the optimistic receipt does nothing.
Because the optimistic receipt modifies Lines 6633 to 6636 in 0bcd005
Screen.Recording.2024-06-25.at.19.14.37.mov |
…ion-is-removed [CP Staging] Fix existing expense is removed when dismissing receipt error (cherry picked from commit e2040ff)
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.0.1-17 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.1-19 🚀
|
Details
Clearing the receipt upload error will delete the existing transaction too. This PR fix it by making sure the transaction is deleted only if it's failed to create.
Fixed Issues
$ #44246
PROPOSAL: #44246 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-06-25.at.11.13.59.mov
Android: mWeb Chrome
Screen.Recording.2024-06-25.at.11.06.46.mov
iOS: Native
Screen.Recording.2024-06-25.at.11.06.03.mov
iOS: mWeb Safari
Screen.Recording.2024-06-25.at.10.59.10.mov
MacOS: Chrome / Safari
Screen.Recording.2024-06-25.at.11.05.19.mov
MacOS: Desktop
Screen.Recording.2024-06-25.at.11.02.06.mov