Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.53k stars 2.88k forks source link

[HOLD for payment 2024-01-11] [$500] IOU - Can't download receipt image #33474

Closed lanitochka17 closed 10 months ago

lanitochka17 commented 10 months ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.15.1 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: Applause - Internal Team Slack conversation:

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Navigate to a workspace chat
  3. Go offline
  4. Do a scan IOU
  5. Download the image

Expected Result:

I should be able to download it

Actual Result:

Can't download the receipt image

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/5d116036-7648-453d-952e-ce43cb0752e8

View all open jobs on GitHub

melvin-bot[bot] commented 10 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01886b4eae0edf845e

melvin-bot[bot] commented 10 months ago

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 10 months ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 10 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External)

namhihi237 commented 10 months ago

Proposal

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

Can not download receipt when offline

What is the root cause of that problem?

When we offline the image doest not upload to S3 show the source file is local but we have isAuthTokenRequired is true, so the URL has a encryptedSourceUrl. That is wrong

We do not return the isLocalFile https://github.com/Expensify/App/blob/659f509b7e1093252d7c2ea14d0082ee78dd6503/src/libs/ReceiptUtils.ts#L45-L49 So here, isAuthTokenRequired is true with the local file

https://github.com/Expensify/App/blob/659f509b7e1093252d7c2ea14d0082ee78dd6503/src/components/ReportActionItem/ReportActionItemImage.js#L87

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

We shouldupdate

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

What alternative solutions did you explore? (Optional)

We can always return isLocalFile for the rest case

bfitzexpensify commented 10 months ago

@shubham1206agra what do you think of @namhihi237's proposal? Is this a fairly simple change? I think it would be ideal for this to work, but this feels like a fairly unusual flow for someone to follow

shubham1206agra commented 10 months ago

@shubham1206agra what do you think of @namhihi237's proposal? Is this a fairly simple change? I think it would be ideal for this to work, but this feels like a fairly unusual flow for someone to follow

Actually, it can be quite common for someone to follow this route. Example is what if I clicked the image of a receipt, and I just want a copy of the image in my local storage too. Then this flow can be followed

shubham1206agra commented 10 months ago

@namhihi237's proposal looks good to me.

🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 10 months ago

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

melvin-bot[bot] commented 10 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 10 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.21-4 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-01-11. :confetti_ball:

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 10 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 10 months ago

Issue is ready for payment but no BZ is assigned. @sakluger you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

melvin-bot[bot] commented 10 months ago

Payment Summary

[Upwork Job]()

BugZero Checklist (@sakluger)

sakluger commented 10 months ago

Sent offers via Upwork. @shubham1206agra could you please complete the BZ checklist?

namhihi237 commented 10 months ago

@sakluger accepted

sakluger commented 10 months ago

Thanks @namhihi237! I completed your payment.

shubham1206agra commented 10 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

shubham1206agra commented 10 months ago

@sakluger Checklist done

sakluger commented 10 months ago

Thank you! All paid out 👍