Skip to content
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

[Awaiting Payment 26th Jane] [$500] PDF receipt doesn't load in the receipt modal #33412

Closed
6 tasks done
trjExpensify opened this issue Dec 21, 2023 · 52 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor SmartScan Wave5-free-submitters

Comments

@trjExpensify
Copy link
Contributor

trjExpensify commented Dec 21, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


This was fixed here, but broke again as per here.

As for the PDF receipt thumbnails, that's being worked on in this issue.

Version Number: v1.4.15-0
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
Expensify/Expensify Issue URL:
Issue reported by: @trjExpensify
Slack conversation:

Action Performed:

  1. Request Money > Scan
  2. Upload a PDF receipt > confirm
  3. Click the report preview component to navigate to the expense report
  4. Click the request preview component to navigate to the transaction thread
  5. Click the thumbnail of the receipt to access the receipt modal

Expected Result:

PDF image should load

Actual Result:

We get a "failed to load" error

Workaround:

None (well, go to OldDot and you can see it if it's an expenseReport

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

image

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015df189659b56a1d4
  • Upwork Job ID: 1737830160739762176
  • Last Price Increase: 2023-12-21
  • Automatic offers:
    • namhihi237 | Contributor | 28070111
@trjExpensify trjExpensify added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 2023

Current assignee @trjExpensify is eligible for the Bug assigner, not assigning anyone new.

@melvin-bot melvin-bot bot changed the title PDF receipt doesn't load in the receipt modal [$500] PDF receipt doesn't load in the receipt modal Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015df189659b56a1d4

Copy link

melvin-bot bot commented Dec 21, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 2023

Current assignee @sobitneupane is eligible for the External assigner, not assigning anyone new.

@trjExpensify
Copy link
Contributor Author

CC: @Talha345 from here: #27680 (comment)

@Talha345
Copy link
Contributor

@trjExpensify Should I open a PR?

@trjExpensify
Copy link
Contributor Author

Sure! Can you quickly recap the plan of action though on this issue and @sobitneupane can give it a quick 👀

@Talha345
Copy link
Contributor

@trjExpensify Sure! I will do that in a few hours.

Can you please assign the issue to me in the meantime?

@trjExpensify
Copy link
Contributor Author

We'll need to see the proposal first before assigning out the issue sorry!

@namhihi237
Copy link
Contributor

namhihi237 commented Dec 21, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

PDF image should load when open the receipt modal

What is the root cause of that problem?

Currently we isLocalFile has true while we load the receipt from the S3, so the isAuthTokenRequired is false

isAuthTokenRequired={!isLocalFile}

We set true here

return {thumbnail: image, image: path, isLocalFile: true};

What changes do you think we should make in order to solve the problem?

We should update to check if is local file use

  const isLocalFile = path.startsWith('blob:') || path.startsWith('file:');
    return {thumbnail: image , image: path, isLocalFile};

What alternative solutions did you explore? (Optional)

N/A

Result:

Screen.Recording.2023-12-21.at.21.00.52.mov

@sobitneupane
Copy link
Contributor

sobitneupane commented Dec 21, 2023

@namhihi237 I don't think the change you proposed will be enough. Instead of thumbnail, loading Indicator is displayed in money request view and preview.
Screenshot 2023-12-21 at 19 59 17

@Talha345
Copy link
Contributor

Talha345 commented Dec 21, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

PDF image is not loading in the receipt modal.

What is the root cause of that problem?

In getThumbnailAndImageURIs method, we are passing isLocalFile: true always.

return {thumbnail: image, image: path, isLocalFile: true};

While this works till the time the PDF file is being uploaded to the server, once uploaded the file is no longer a local file and therefore requires authentication to get the file from the server which can be seen as follows:

isAuthTokenRequired={!isLocalFile}

What changes do you think we should make in order to solve the problem?

We can simply check if a file is local or not by making the following change:

return {thumbnail: image, image: path, isLocalFile: path.startsWith('blob:') || path.startsWith('file:')};

What alternative solutions did you explore? (Optional)

N/A

Result:

Screen.Recording.2023-12-21.at.19.46.33.mp4

@namhihi237
Copy link
Contributor

@sobitneupane what do you mean, currently, the thumbnail always shows with PDF

@sobitneupane
Copy link
Contributor

@Talha345 Your proposal is not much different from initial proposal (before edit) by @namhihi237.

@namhihi237 Please add a comment following the guideline after updating proposal.

Sorry for the confusion here. Loading Indicator was being displayed instead of Thumbnail, previously. But, after clearing the cache, the issue is not reproducible any longer.

Proposal from @namhihi237 looks good to me.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 21, 2023

Triggered auto assignment to @MonilBhavsar, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Talha345
Copy link
Contributor

Talha345 commented Dec 21, 2023

@sobitneupane During the proposal review for #27680, I had the same exact proposal as the one that was chosen but you told me that you chose the other proposal because I incorporated a fix later on in my proposal (which was kind of like a small regression fix that occurred after implementing the proposed solution) and therefore my proposal even though it came early was incomplete.

Now, here you mention that my proposal is not much different from @namhihi237's original proposal but obviously when that proposal was posted it was incomplete and that's why I posted a complete solution to avoid any missing case.

There should be some standardisation in this process TBH. Also, I think in this case I volunteered earlier to work on this issue because as I was already familiar with these changes.

Also, apologies for being a bit blunt but the selected proposal was edited multiple (6) times so I do not understand to which version my proposal is not much different from. If it was not much different, there should not have the need for such multiple edits.

@sobitneupane
Copy link
Contributor

During the proposal review for #27680, I had the same exact proposal as the one that was chosen but you told me that you chose the other proposal because I incorporated a fix later on in my proposal (which was kind of like a small regression fix that occurred after implementing the proposed solution) and therefore my proposal even though it came early was incomplete.

@Talha345 Regarding previous issue, the difference between the two proposals was significant enough to go with the other.

Now, here you mention that my proposal is not much different from @namhihi237's original proposal but obviously when that proposal was posted it was incomplete and that's why I posted a complete solution to avoid any missing case.

Regarding this issue, two proposals doesn't look significantly different to me. If @MonilBhavsar thinks other wise, I am happy to go with your proposal.

Also, apologies for being a bit blunt but the selected proposal was edited multiple (6) times so I do not understand to which version my proposal is not much different from. If it was not much different, there should not have the need for such multiple edits.

This was the proposal I initially reviewed
Screenshot 2023-12-21 at 23 41 44

@Talha345
Copy link
Contributor

@sobitneupane Okay, I would be happy to accept what @MonilBhavsar's judgement here, but it is also important to note that the Expensify docs mention that you are supposed to put an "Updated Proposal" comment whenever you make a change to an existing proposal which was also not followed in this case.

Copy link

melvin-bot bot commented Jan 5, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Jan 5, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@sobitneupane
Copy link
Contributor

@namhihi237 If you are around, can you please handle above cases?

@namhihi237
Copy link
Contributor

Sure I will raise this PR

@sobitneupane
Copy link
Contributor

Let's make sure to add tests covering all the Attachment Views.

@namhihi237
Copy link
Contributor

@sobitneupane PR already here #34030

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jan 5, 2024
@parasharrajat
Copy link
Member

parasharrajat commented Jan 8, 2024

PR of this issue caused a regression #34049 cc @trjExpensify

@trjExpensify
Copy link
Contributor Author

Ah, is it the same root being fixed here?

@sobitneupane
Copy link
Contributor

Yup @trjExpensify. The issue has been addressed in #34030.

@trjExpensify
Copy link
Contributor Author

Cool, so we'll count that as the one then!

@dylanexpensify
Copy link
Contributor

Nice, should we close this?

@trjExpensify
Copy link
Contributor Author

Going to close, if someone wants to let me know otherwise -- great!

@github-project-automation github-project-automation bot moved this from Release 3: Migration for All to Done in [#whatsnext] Wave 05 - Deprecate Free Jan 26, 2024
@namhihi237
Copy link
Contributor

@trjExpensify seem we missing payment

@trjExpensify
Copy link
Contributor Author

Oh sorry, I totally thought there was another issue for this one!

@trjExpensify trjExpensify reopened this Jan 26, 2024
@trjExpensify
Copy link
Contributor Author

Okay, so payments..

1 regression to account for, as the second regression had the same root cause.

Correct?

@trjExpensify trjExpensify added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Jan 26, 2024
@trjExpensify trjExpensify changed the title [$500] PDF receipt doesn't load in the receipt modal [Awaiting Payment 26th Jane] [$500] PDF receipt doesn't load in the receipt modal Jan 26, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 2, 2024
@MonilBhavsar
Copy link
Contributor

Looks good! Let's pay

@trjExpensify
Copy link
Contributor Author

Cool, thanks for confirming!

@trjExpensify
Copy link
Contributor Author

@sobitneupane you're free to request $250 as per here. Closing!

@JmillsExpensify
Copy link

$250 approved for @sobitneupane based on summary above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor SmartScan Wave5-free-submitters
Projects
No open projects
Development

No branches or pull requests

9 participants