You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] Android - IOU - Validation message not shown when file above 25mb for Smart Recipe was selected #27389
showImagePicker(launchImageLibrary).then((receiptImage)=>{if(receiptImage[0].fileSize>CONST.IOU.MAX_RECEIPT_FILE_SIZE){// show error modal if the file size is too large}elseif(receiptImage[0].fileSize<CONST.IOU.MIN_RECEIPT_FILE_SIZE){// show error modal if the file size is too small}
What changes do you think we should make in order to solve the problem?
In the callback of Native platforms here, we need to reuse above util ReceiptUtils.validateReceipt to validate same as we did for default platform.
In native platform, the prop to get size is file.fileSize, instead of file.size, so in the util ReceiptUtils.validateReceipt, we need to modify a bit to get file size in either file.size or file.fileSize
In order to show attachment error popup, we need to render the ConfirmModal same as we did for default platform too
Okay it's not a regression because we didn't ever have the size validation on mobile. As part of this fix, let's make sure we add the validation across all platforms where it hasnt been added yet.
changed the title [-]Android - IOU - Validation message not shown when file above 25mb for Smart Recipe was selected[/-][+][$500] Android - IOU - Validation message not shown when file above 25mb for Smart Recipe was selected[/+]on Sep 18, 2023
On IOS, sometimes the transition when opening the modal is not smooth, I believe the Root cause is that closing of photos gallery and Confirm modal overlaps, so i have added a delay in opening in the modal @allroundexperts has not approved the change and didn't provide any feedback
On IOS, sometimes the transition when opening the modal is not smooth, I believe the Root cause is that closing of photos gallery and Confirm modal overlaps, so i have added a delay in opening in the modal @allroundexperts has not approved the change and didn't provide any feedback
Okay i see there is some missunderstanding i replied everytime @allroundexperts bumped but my reply didn't get to them because of some issue with GH thread showing pending (i didn't realized the pending label is for not delivered)
I'd like to understand why we are using the Native Alert Modal instead of a Custom Modal in our project. This might create inconsistency since we use Custom Modals on the web. Is there a specific reason for this choice?
I'm concerned that my work in #27960 might be wasted if the issue is already addressed in #29963. Should I close the PR?
I'd like to understand why we are using the Native Alert Modal instead of a Custom Modal in our project. This might create inconsistency since we use Custom Modals on the web. Is there a specific reason for this choice?
Native alert is already used in various parts: corrupted image, download, permission, camera errors
If we should use custom alert for all platforms for consistency, we should fix it for all cases, not only this one.
Btw, it's new issue and should get design approval. Out of scope for this one.
In summary, we are addressing this issue in #29663. I agree with @situchan we place this issue on hold for #29663. Additionally, I'm closing #27960 since there's already a pull request handling the issue.
Given that there is decent effort invested, should I expect of receiving a partial payment for this issue? Do we agree 👍 or 👎
Activity
melvin-bot commentedon Sep 13, 2023
Triggered auto assignment to @sakluger (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 13, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)ishpaul777 commentedon Sep 13, 2023
Proposal
Problem
Validation message not shown when file above 25mb for Smart Recipe was selected
Root cause
There is no validation of file size or any other validation on after image is picked
https://github.com/ishpaul777/App/blob/1bdc5acc12f982b4f6e37bfadf9060ac3d2d3b3c/src/pages/iou/ReceiptSelector/index.native.js#L262
Changes
Validate the image picked by user for fileSize.(Asset picked by user has a fileSize property https://www.npmjs.com/package/react-native-image-picker)
hoangzinh commentedon Sep 14, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Android - IOU - Validation message not shown when file above 25mb for Smart Recipe was selected
What is the root cause of that problem?
In the callback after select file in Native platforms, we haven't validate the valid of file, including file type & file size yet
App/src/pages/iou/ReceiptSelector/index.native.js
Lines 260 to 269 in 6764fd1
Like we did for default platform here
App/src/pages/iou/ReceiptSelector/index.js
Lines 80 to 82 in 6764fd1
App/src/libs/ReceiptUtils.js
Lines 12 to 30 in 6764fd1
What changes do you think we should make in order to solve the problem?
ReceiptUtils.validateReceiptto validate same as we did for default platform.file.fileSize, instead offile.size, so in the utilReceiptUtils.validateReceipt, we need to modify a bit to get file size in eitherfile.sizeorfile.fileSizeApp/src/pages/iou/ReceiptSelector/index.js
Lines 143 to 151 in 6764fd1
Result

sakluger commentedon Sep 14, 2023
Looks like this may be a regression from #25865, I've commented in that issue for clarification.
sakluger commentedon Sep 18, 2023
Okay it's not a regression because we didn't ever have the size validation on mobile. As part of this fix, let's make sure we add the validation across all platforms where it hasnt been added yet.
[-]Android - IOU - Validation message not shown when file above 25mb for Smart Recipe was selected[/-][+][$500] Android - IOU - Validation message not shown when file above 25mb for Smart Recipe was selected[/+]melvin-bot commentedon Sep 18, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01898f68a06cf0cea0
melvin-bot commentedon Sep 18, 2023
Current assignee @sakluger is eligible for the External assigner, not assigning anyone new.
20 remaining items
ishpaul777 commentedon Nov 1, 2023
On IOS, sometimes the transition when opening the modal is not smooth, I believe the Root cause is that closing of photos gallery and Confirm modal overlaps, so i have added a delay in opening in the modal @allroundexperts has not approved the change and didn't provide any feedback
allroundexperts commentedon Nov 1, 2023
@ishpaul777 Please see #27960 (comment)
ishpaul777 commentedon Nov 1, 2023
Okay i see there is some missunderstanding i replied everytime @allroundexperts bumped but my reply didn't get to them because of some issue with GH thread showing pending (i didn't realized the pending label is for not delivered)
ishpaul777 commentedon Nov 1, 2023
@situchan Is #29963 solving this issue too?
situchan commentedon Nov 1, 2023
I think so
ishpaul777 commentedon Nov 1, 2023
I'd like to understand why we are using the Native Alert Modal instead of a Custom Modal in our project. This might create inconsistency since we use Custom Modals on the web. Is there a specific reason for this choice?
I'm concerned that my work in #27960 might be wasted if the issue is already addressed in #29963. Should I close the PR?
situchan commentedon Nov 1, 2023
Native alert is already used in various parts: corrupted image, download, permission, camera errors
ishpaul777 commentedon Nov 1, 2023
I meant for similar case like validation error on web has a custom modal I think?
situchan commentedon Nov 1, 2023
yes because web native alert is ugly
situchan commentedon Nov 1, 2023
If we should use custom alert for all platforms for consistency, we should fix it for all cases, not only this one.
Btw, it's new issue and should get design approval. Out of scope for this one.
ishpaul777 commentedon Nov 1, 2023
In summary, we are addressing this issue in #29663. I agree with @situchan we place this issue on hold for #29663. Additionally, I'm closing #27960 since there's already a pull request handling the issue.
Given that there is decent effort invested, should I expect of receiving a partial payment for this issue? Do we agree 👍 or 👎
allroundexperts commentedon Nov 2, 2023
Hm... Yes, holding makes sense. @ishpaul777 I'm not sure if we consider partial payments for issues that are on hold.
melvin-bot commentedon Jan 1, 2024
@deetergp, @sakluger, @allroundexperts, @ishpaul777, this Monthly task hasn't been acted upon in 6 weeks; closing.
If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.