Fix receipt upload size issue#50329
Conversation
|
@OlimpiaZurek Would you mind updating test steps? Thx |
|
I was able to upload the receipt on my simulator, is it expected? 0-ios.mp4 |
Hey @eh2077! You should check if the heic image is uploaded correctly. I added QA steps to the PR description. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: Native0-ios.mp40-ios1.mp4iOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
eh2077
left a comment
There was a problem hiding this comment.
Tested well, just minor comments
| const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID ?? -1}`); | ||
| const policy = usePolicy(report?.policyID); | ||
| const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); | ||
| const [skipConfirmation] = useOnyx(`${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`); |
There was a problem hiding this comment.
Is it necessary to have the nullish coalescing? like
| const [skipConfirmation] = useOnyx(`${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`); | |
| const [skipConfirmation] = useOnyx(`${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID ?? -1}`); |
I saw line 67 has similar usage for reportID.
mountiny
left a comment
There was a problem hiding this comment.
Thanks! One NAB comment but would be nice to get the styling right before merging
|
✋ 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/mountiny in version: 9.0.47-1 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.47-4 🚀
|
| } | ||
|
|
||
| if (!Str.isImage(file.name ?? '') && (file?.size ?? 0) > CONST.API_ATTACHMENT_VALIDATIONS.MAX_SIZE) { | ||
| if (!Str.isImage(file.name ?? '') && (file?.size ?? 0) > CONST.API_ATTACHMENT_VALIDATIONS.RECEIPT_MAX_SIZE) { |
There was a problem hiding this comment.
Should have updated the max size in error message to 10MB (formerly 24MB) as well. Caused this issue #53341.
Details
This PR fixes an issue where requests fail because the uploaded file size exceeds the 10MB limit after HEIC to JPEG conversion. The fix includes adding a separate
const RECEIPT_IMAGE_MAX_SIZE=10MBto align with the backend limit for receipt uploads.QA steps:
Fixed Issues
$ #49999
PROPOSAL: #49999 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
MacOS: Desktop