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][$250] Attachment - A broken video file is loaded via action menu #46343

Closed
2 of 6 tasks
lanitochka17 opened this issue Jul 27, 2024 · 22 comments
Closed
2 of 6 tasks
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 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 27, 2024

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


Version Number: 9.0.13-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: https://expensify.testrail.io/index.php?/tests/view/4771740
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open https://staging.new.expensify.com/.
  2. Log in with any account
  3. Navigate to any conversation or create one
  4. Send any video to the conversation
  5. Wait for the video to upload
  6. Open the action menu on the message containing the video
  7. Click Download

Expected Result:

Using the action menu, the video file should be downloaded uncorrupted

Actual Result:

A corrupted video file is loaded via the action menu

Workaround:

Unknown

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

Add any screenshot/video evidence

Bug6553984_1722019133203.Recording__27__2_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011ea5f33ec2b35a17
  • Upwork Job ID: 1818205757531703482
  • Last Price Increase: 2024-07-30
  • Automatic offers:
    • alitoshmatov | Reviewer | 103356880
    • Krishna2323 | Contributor | 103356881
Issue OwnerCurrent Issue Owner: @kadiealexander
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 27, 2024
Copy link

melvin-bot bot commented Jul 27, 2024

Triggered auto assignment to @kadiealexander (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.

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@lanitochka17
Copy link
Author

@kadiealexander 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

@neonbhai
Copy link
Contributor

neonbhai commented Jul 27, 2024

Proposal

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

Attachment - A broken video file is loaded via action menu

What is the root cause of that problem?

The root cause is we lose the correct file name here:

const completeFileName = FileUtils.appendTimeToFileName(fileName ?? FileUtils.getFileName(url));

This happens as when fileName is empty string, ?? operator is not triggered,

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

We will use || operator to make sure FileUtils.getFileName(url) is called.

const completeFileName = FileUtils.appendTimeToFileName(fileName || FileUtils.getFileName(url));

Alternatively

We may use another variable to calculate param.

Result

This works perfectly

Screen.Recording.2024-07-27.at.9.03.28.AM.mp4

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 27, 2024

Proposal

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

Attachment - A broken video file is loaded via action menu

What is the root cause of that problem?

  • The filename regex only covers the case for images and anchor elements.
    const ORIGINAL_FILENAME_REGEX = IS_IMAGE_TAG ? new RegExp(`${CONST.ATTACHMENT_ORIGINAL_FILENAME_ATTRIBUTE}*=*"(.+?)"`, 'i') : new RegExp('<a[^>]*>([^<]+)</a>', 'i');
  • It works well when getting the text inside <a>text</a> but it isn't configured for <video>text</video> elements.
<a href="https://www.expensify.com/chat-attachments/5472531993863123939/w_ebdde7322a1d6097c0640c162fcdf6aaa9280ee6.xml" data-expensify-source="https://www.expensify.com/chat-attachments/5472531993863123939/w_ebdde7322a1d6097c0640c162fcdf6aaa9280ee6.xml">intacct_expensify_1_1_0.xml</a>

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

We need to modify the regex to also consider for video tags.

new RegExp('<(?:a|video)[^>]*>([^<]+)</(?:a|video)>', 'i');

What alternative solutions did you explore? (Optional)

Result

Monosnap.screencast.2024-07-27.10-55-45.mp4

@melvin-bot melvin-bot bot added the Overdue label Jul 29, 2024
@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

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

@melvin-bot melvin-bot bot changed the title Attachment - A broken video file is loaded via action menu [$250] Attachment - A broken video file is loaded via action menu Jul 30, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jul 30, 2024
@alitoshmatov
Copy link
Contributor

@neonbhai Thank you for your proposal, your RCA is correct but the main problem here is fileName being empty where it shouldn't. We should fix this rather than adjusting our code to work with this issue

@alitoshmatov
Copy link
Contributor

@Krishna2323 Thank you for your proposal, your RCA is correct and your solution does solve the issue of fileName being empty.

We can go with @Krishna2323 's proposal

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Aug 1, 2024

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

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

melvin-bot bot commented Aug 1, 2024

📣 @alitoshmatov 🎉 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

Copy link

melvin-bot bot commented Aug 1, 2024

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@Krishna2323
Copy link
Contributor

@alitoshmatov, PR ready for review ^

@Krishna2323
Copy link
Contributor

@alitoshmatov, friendly bump for PR review.

@danieldoglas
Copy link
Contributor

I think this was deployed to production yesterday. So now we have a regression period of 7 days. cc @kadiealexander

@Krishna2323
Copy link
Contributor

@kadiealexander, this is ready for payments as per the comment above.

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Aug 26, 2024
Copy link

melvin-bot bot commented Aug 26, 2024

This issue has not been updated in over 15 days. @danieldoglas, @kadiealexander, @alitoshmatov, @Krishna2323 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Aug 26, 2024
@Krishna2323
Copy link
Contributor

@kadiealexander, friendly bump for payments.

@alitoshmatov
Copy link
Contributor

Waiting for payment, PR was deployed on 14th of august

@kadiealexander kadiealexander added Daily KSv2 and removed Monthly KSv2 labels Sep 3, 2024
@Krishna2323
Copy link
Contributor

@kadiealexander, friendly bump for payments :)

@danieldoglas danieldoglas added the Awaiting Payment Auto-added when associated PR is deployed to production label Sep 9, 2024
@danieldoglas danieldoglas changed the title [$250] Attachment - A broken video file is loaded via action menu [Awaiting Payment][$250] Attachment - A broken video file is loaded via action menu Sep 9, 2024
@danieldoglas
Copy link
Contributor

added the correct labels and assigned @kadiealexander to be the main person responsible for this issue.

@kadiealexander
Copy link
Contributor

kadiealexander commented Sep 10, 2024

Payouts due:

Upwork job is here.

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 Reviewing Has a PR in review
Projects
No open projects
Status: No status
Development

No branches or pull requests

6 participants