-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: show error message for invalid receipt #34087
fix: show error message for invalid receipt #34087
Conversation
@hoangzinh 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] |
@tienifr, a few quick reviews for PR checklist
|
src/libs/ReceiptUtils.ts
Outdated
@@ -30,9 +32,10 @@ type FileNameAndExtension = { | |||
*/ | |||
function getThumbnailAndImageURIs(transaction: Transaction, receiptPath: string | null = null, receiptFileName: string | null = null): ThumbnailAndImageURI { | |||
// URI to image, i.e. blob:new.expensify.com/9ef3a018-4067-47c6-b29f-5f1bd35f213d or expensify.com/receipts/w_e616108497ef940b7210ec6beb5a462d01a878f4.jpg | |||
const path = transaction?.receipt?.source ?? receiptPath ?? ''; | |||
const errors = _.findLast(transaction.errors) as ReceiptError | 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.
Do we need union type here ReceiptError | null
, can it be ReceiptError
only?
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.
error can be undefined (receipt without error), so I think it should be ReceiptError | undefined
@tienifr also we're missing recordings for Android platform |
cc @tienifr, just in case you missed this PR |
@hoangzinh I updated the PR, will add the screenshots in a few minutes |
Reviewer Checklist
Screenshots/VideosAndroid: Native2488984317132467882.mp4Android: mWeb ChromeScreen.Recording.2024-01-26.at.23.18.15.android.chrome.moviOS: NativeScreen.Recording.2024-01-27.at.15.31.28.ios.moviOS: mWeb SafariScreen.Recording.2024-01-27.at.15.33.20.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-01-26.at.23.07.57.web.movMacOS: DesktopScreen.Recording.2024-01-26.at.23.09.59.desktop.mov |
@tienifr When I click "download" link on Web, the file is downloaded but the file name is weird. Have you faced same issue as me? |
@hoangzinh Ah, sorry. The filename should be file.name (I missed it when fixing the conflict). I updated |
@tienifr I found another bug, when receipt is failed to upload, there is no IOU error in LHN or in the parent report. Screen.Recording.2024-01-22.at.17.05.42.mov |
I'm checking |
@hoangzinh I see this behavior is present on main. LHN does not show the red dot. Screen.Recording.2024-01-25.at.16.01.52.mov |
@tienifr have you faced same error with me in Android platform? I couldn't download error image |
@jasperhuangg could you help to trigger adhoc builds for Android so I can test this PR on a real device? My Mac has a problem so I can't make a connection to my Android device to install our Expensify Dev app via react-native |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
Thanks @jasperhuangg |
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
✋ 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/francoisl in version: 1.4.33-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 1.4.34-0 🚀
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 1.4.34-0 🚀
|
@tienifr I think this PR caused this regression, could you please look into it? |
🚀 Deployed to production by https://github.com/francoisl in version: 1.4.34-1 🚀
|
errors={transaction.errors} | ||
errorRowStyles={[styles.ml4]} | ||
onClose={() => { | ||
Transaction.clearError(transaction.transactionID); |
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 missed handling the case of createChat
errorfields which would happen when the creation of the chat itself fails thereby causing #43481.
Details
Fixed Issues
$ #28343
PROPOSAL: #28343 (comment)
Tests
Offline tests
Same as above
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 methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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-01-17.at.14.23.39.mov
Android: mWeb Chrome
Screen.Recording.2024-01-17.at.14.13.08.mov
iOS: Native
Screen.Recording.2024-01-08.at.13.22.18.mov
iOS: mWeb Safari
Screen.Recording.2024-01-08.at.12.30.50.mov
MacOS: Chrome / Safari
Screen.Recording.2024-01-08.at.12.26.17.mp4
MacOS: Desktop
Screen.Recording.2024-01-08.at.13.25.01.mp4