-
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
[HOLD for payment 2023-11-22] [SMARTSCAN] [$500] HIGH: Web - Scan - Failed to load PDF file uploaded in request money scan #27680
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01fcbb8f9acc8d0c31 |
Triggered auto assignment to @sonialiap ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @garrettmknight ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Opening a scanned PDF from a scan report fails. What is the root cause of that problem?The thumbnail image shown in the bug report video is a
The problem is that for a PDF, this is the preview image, not the PDF. When
What changes do you think we should make in order to solve the problem?
|
Unnassigning since @sonialiap was first! |
ProposalPlease re-state the problem that we are trying to solve in this issue.When a PDF is used for request money via the scan feature, it is not loaded for preview in the attachment modal via the request money report. What is the root cause of that problem?The App/src/components/ReportActionItem/MoneyRequestView.js Lines 92 to 95 in 6be8fca
The ReportActionItemImage then displays the thumbnail or image and the image source URL is used to open the attachment. In case of PDF, the
Line 52 in 6be8fca
Therefore, when the AttachmentView tries to display the attachment, the following if clause succeeds because the
What changes do you think we should make in order to solve the problem?We can add the following if clause to
In order to display the thumbnail image in RHN while requesting money we would have to update the image source here with the following change App/src/components/MoneyRequestConfirmationList.js Lines 442 to 446 in 6be8fca
What alternative solutions did you explore? (Optional)N/A Result:Screen.Recording.2023-09-22.at.01.32.00.mov |
ProposalPlease re-state the problem that we are trying to solve in this issue.Failed to load PDF file uploaded in request money scan What is the root cause of that problem?here we are returning the static image even pdf. Line 64 in 6be8fca
static image used in preview
What changes do you think we should make in order to solve the problem?we should change this Line 64 in 6be8fca
to return {thumbnail: image, image: path}; this will work for other typenow we are focusing the only pdf so if (fileExtension === 'pdf')
{
return {thumbnail: image, image: path};
} and here we can create const for pdf Line 1152 in 02ad2fc
so that all static image show in the thumbnail and the original path take to preview because in native device local import as reference number we already did this some of component App/src/components/ReportActionItem/ReportActionItemImage.js Lines 18 to 19 in 6be8fca
when we change this it will create regression here
so here we need to change let receiptPathImage;
if (!_.isEmpty(props.receiptPath)) {
const image = ReceiptUtils.getThumbnailAndImageURIs(props.receiptPath, props.receiptSource)
receiptPathImage = image.thumbnail || image.image
}
......
source={{uri: receiptPathImage}} here thumbnail is always an image except in this case
|
@sobitneupane looks like we have proposals rolling in, any thoughts on the ones we currently have? |
Thanks for the proposal @ewanmellor
Your solution should include how you are going to achieve the result. |
Thanks for the proposal @Talha345. With the change you suggested, I'm observing a loading indicator instead of the thumbnail. |
@pradeepmdk Thanks for the proposal. What change are you suggesting in |
DO we have any issue with docx? |
Hi @sobitneupane, make sure you are adding the if clause at the correct place within the method like: Seems to be working fine for me, however I noticed that the thumbnail image was not loading in the RHN after choosing the PDF file during request money with my change so we need to make another change at some place and I have updated my proposal accordingly. |
@sobitneupane With docx, currently we are displaying the docx generic image because we do not have the capability to display docx attachments even when we send them in the chat.We only preview images and PDFs Screen.Recording.2023-09-25.at.12.03.35.mov |
@sonialiap any update for payment |
@pradeepmdk fix = $500 - paid ✔️ |
@sobitneupane please complete the checklist |
I think the comment above is still valid? @sobitneupane |
Yes, still need the checklist competed :) |
@sobitneupane bump on completing the checklist |
@rlinoz, @pradeepmdk, @sonialiap, @Gonals, @sobitneupane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Sorry for the delay. I will get it done asap. |
#24235 was the PR which introduced the feature of SmartScan to newDot. The PR mainly focused on images as receipt. So, Rather than a bug, I will say it was work on progress.
N/A
N/A
Yes.
|
Regression Test Proposal:
Do we agree 👍 or 👎 |
Thanks, Sobit! Submitting regression test and closing this out |
Requested payment on newDot. |
$500 payment approved for @sobitneupane based on this comment. |
👋 Heads up! @pradeepmdk @sobitneupane @Gonals this seems to have broken again: Any chance you'd be willing to help us diagnose so we can create a follow-up issue/PR to fix it, or maybe encapsulate it into this issue? CC: @RachCHopkins |
Found the cause.
@pradeepmdk Will you be willing to create PR to fix the issue. |
Niceee sleuthing! ❤️ @pradeepmdk could you let us know today if you'd be up for fixing that? |
@trjExpensify @sobitneupane I would be available to fix this follow up issue if @pradeepmdk is not available anymore as I was also involved in this during the proposal and discussion phase! 😊 |
Nice, let's go for it! Fresh issue here: #33412 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The pdf should be loaded.
Actual Result:
The pdf is not loaded correctly.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.71.4
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Untitled.mp4
Recording.4564.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Krishna2323
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694901873701159
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: