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

[HOLD for payment 2024-10-11] [$250] Android/iOS - Attachment error displayed when uploading pdf with grave accent in name #49449

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 19, 2024 · 25 comments
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

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 19, 2024

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: 9.0.37.3
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the app and log in
  2. Navigate to any report
  3. Tap "+" > Add attachment > Choose file
  4. Select a pdf file with a name containing a grave accent `

Expected Result:

The pdf file is uploaded

Actual Result:

Unable to upload the pdf, the attachment error is displayed

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Ragù alla bolognese - updated recipe_20 April 2023.pdf

Bug6607697_1726667305160.video_2024-09-18_09-47-32.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838993266760256220
  • Upwork Job ID: 1838993266760256220
  • Last Price Increase: 2024-09-25
  • Automatic offers:
    • jjcoffee | Reviewer | 104216292
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 19, 2024
Copy link

melvin-bot bot commented Sep 19, 2024

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@IuliiaHerets
Copy link
Author

@JmillsExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

Copy link

melvin-bot bot commented Sep 19, 2024

📣 @Buqra55! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot melvin-bot bot added the Overdue label Sep 23, 2024
@bernhardoj
Copy link
Contributor

Proposal

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

An attachment error is shown when trying to upload a PDF with an accented character in the name.

What is the root cause of that problem?

When we select the attachment from the document picker, the file source URI is encoded. In our case, character is encoded to %C3%B9. Then, we try to show the PDF using the component from react-native-pdf library.

The react-native-pdf already tries to decode it using unescape method,
https://github.com/wonday/react-native-pdf/blob/d545ff27b49850c773f6c443dfc65891881c0ed2/index.js#L238

however, it decodes %C3%B9 to ù which is a wrong character. So, the PDF component throws a file not found error.

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

We can replace unescape with decodeURIComponent. Based on the MDN doc, the unescape is also deprecated.

The upstream repo looks inactive, so I think we can just patch it.

Copy link

melvin-bot bot commented Sep 24, 2024

@JmillsExpensify Huh... This is 4 days overdue. Who can take care of this?

@JmillsExpensify
Copy link

Opening up to the community. Pending proposal review.

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2024
@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor Overdue labels Sep 25, 2024
@melvin-bot melvin-bot bot changed the title Android/iOS - Attachment error displayed when uploading pdf with grave accent in name [$250] Android/iOS - Attachment error displayed when uploading pdf with grave accent in name Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

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

@mahaidery
Copy link

Contributor details:
Your Expensify account email: mahaidery@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01232d5f52fda26a6c

Copy link

melvin-bot bot commented Sep 25, 2024

📣 @mahaidery! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@jjcoffee
Copy link
Contributor

@bernhardoj's proposal LGTM! I'm not 100% sure what we'd do here in terms of patching vs upstream fix, but I'd think since this is a fairly simple change we can patch it now but also open a PR upstream and try to get that merged simultaneously?

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 26, 2024

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

@neil-marcellini
Copy link
Contributor

@bernhardoj's proposal LGTM! I'm not 100% sure what we'd do here in terms of patching vs upstream fix, but I'd think since this is a fairly simple change we can patch it now but also open a PR upstream and try to get that merged simultaneously?

🎀👀🎀 C+ reviewed

I agree, hiring

@melvin-bot melvin-bot bot added the Overdue label Oct 1, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 1, 2024
Copy link

melvin-bot bot commented Oct 1, 2024

📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot removed the Overdue label Oct 1, 2024
@bernhardoj
Copy link
Contributor

@jjcoffee PR is ready

Upstream PR: wonday/react-native-pdf#873

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 4, 2024
@melvin-bot melvin-bot bot changed the title [$250] Android/iOS - Attachment error displayed when uploading pdf with grave accent in name [HOLD for payment 2024-10-11] [$250] Android/iOS - Attachment error displayed when uploading pdf with grave accent in name Oct 4, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 4, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

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

Copy link

melvin-bot bot commented Oct 4, 2024

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

If no regressions arise, payment will be issued on 2024-10-11. 🎊

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

Copy link

melvin-bot bot commented Oct 4, 2024

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:

  • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
  • [@jjcoffee] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@jjcoffee] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@jjcoffee] Determine if we should create a regression test for this bug.
  • [@jjcoffee] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 11, 2024
@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: N/A - always existed in react-native-pdf
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
  • Determine if we should create a regression test for this bug. Yes
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

  1. In any chat add a PDF attachment with accented characters in the filename, e.g. Ragù.alla.bolognese.-.updated.recipe_20.April.2023.pdf
  2. Verify the PDF loads correctly

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Oct 14, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

@JmillsExpensify, @neil-marcellini, @jjcoffee, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick!

@JmillsExpensify
Copy link

Payment summary:

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2024
@JmillsExpensify
Copy link

Closing this one out!

@bernhardoj
Copy link
Contributor

Requested in ND.

@trjExpensify
Copy link
Contributor

Confirming the payment summary here is correct.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

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
Projects
None yet
Development

No branches or pull requests

8 participants
@JmillsExpensify @mahaidery @trjExpensify @neil-marcellini @jjcoffee @bernhardoj @IuliiaHerets and others