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 2023-12-15] [$500] Fix regressions related to file downloads #30931

Closed
jasperhuangg opened this issue Nov 6, 2023 · 31 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

@jasperhuangg
Copy link
Contributor

jasperhuangg commented Nov 6, 2023

Fix the regressions identified while testing this PR: #25556

@aimane-chnaif (please update this issue when you get the chance to flesh out the specific regressions)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0128bf854d351a72e3
  • Upwork Job ID: 1721661984680620032
  • Last Price Increase: 2023-11-06
  • Automatic offers:
    • aimane-chnaif | Reviewer | 27690736
@jasperhuangg jasperhuangg added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

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

Copy link

melvin-bot bot commented Nov 6, 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

@jasperhuangg jasperhuangg added the External Added to denote the issue can be worked on by a contributor label Nov 6, 2023
@melvin-bot melvin-bot bot changed the title Fix regressions related to file downloads [$500] Fix regressions related to file downloads Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

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

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

melvin-bot bot commented Nov 6, 2023

Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.

@jasperhuangg
Copy link
Contributor Author

@kidroca was working on the related issue

@aimane-chnaif
Copy link
Contributor

@aimane-chnaif (please update this issue when you get the chance to flesh out the specific regressions)

@jasperhuangg Sure. Please assign @kidroca so they can raise PR

BUG1: [native] Can’t download attachments from Concierge

BUG2: [android] Wrong attachment name when download from Concierge

BUG3: [all] Console error because of undefined fileName in attachment preview

Copy link

melvin-bot bot commented Nov 10, 2023

@aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Nov 10, 2023
@aimane-chnaif
Copy link
Contributor

@jasperhuangg can you please assign @kidroca? (and yourself if you want to)

@melvin-bot melvin-bot bot removed the Overdue label Nov 10, 2023
Copy link

melvin-bot bot commented Nov 13, 2023

@aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
Copy link

melvin-bot bot commented Nov 13, 2023

@aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@aimane-chnaif
Copy link
Contributor

🎀 👀 🎀

Copy link

melvin-bot bot commented Nov 13, 2023

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

@NikkiWines
Copy link
Contributor

@kidroca can you comment on this issue so it adds you as a participant and we can assign the issue to you please 🙇

@kidroca
Copy link
Contributor

kidroca commented Nov 14, 2023

Proposal

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

We are addressing three key bugs in our system related to attachment handling:

  1. BUG1: In the native environment, users are unable to download attachments from Concierge.
  2. BUG2: On Android, downloaded attachments from Concierge display incorrect names.
  3. BUG3: Across all platforms, we're encountering a console error due to an undefined fileName in the attachment preview.

What is the root cause of that problem?

For BUG1, the root cause lies in the handling of Concierge attachments added via drag and drop, which often lack a fileName attribute. The current code attempts to infer a missing name from the URL, but this process is flawed and fails to execute correctly.

In the case of BUG2, it stems from the same issue as BUG1. The incorrect handling of missing file names leads to improperly generated names, particularly with datetime elements that include illegal characters (like :).

For BUG3, the issue arises because fileName is marked as a required property, but there are instances, particularly with some Concierge attachments, where it is not provided. This discrepancy leads to the console error we are witnessing.

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

To resolve BUG1, we should refine the code that deals with downloading attachments. This includes enhancing the logic to handle cases where the fileName attribute is missing, ensuring it can accurately infer the name from the attachment's URL.

To fix BUG2, the solution involves revising the logic that generates file names, especially focusing on how datetime elements are processed. This revision should ensure that the names comply with standard naming conventions and do not include illegal characters.

For BUG3, we have two potential approaches. We can either update the propType for fileName to make it non-required and provide a default value, or we can implement a fallback mechanism where the fileName is inferred from the URL if it is not explicitly provided.

What alternative solutions did you explore? (Optional)

Another solution might be to conduct a thorough audit of all attachment use cases (including server/backend code) to ensure fileName is consistently provided. This approach, while potentially more robust, could be resource-intensive and might not be feasible.

@aimane-chnaif
Copy link
Contributor

Proposal looks good to me.
Regarding BUG3, I am fine with non-required approach for now given that it's unusual case i.e. attachment only from concierge. And there's nowhere displaying file name in UI.
@NikkiWines all yours

@NikkiWines
Copy link
Contributor

Cool, yeah sounds good. Inferring the name from the URL would be a nice way to retain unique filenames though so it might be nice to do that 🤔

@jasperhuangg any strong thoughts either way for bug 3?

@NikkiWines
Copy link
Contributor

@kidroca any update here?

@kidroca
Copy link
Contributor

kidroca commented Nov 23, 2023

Posted a PR here

It's ready for code review, though I need to update the description with test steps and complete the rest of the checklist

Copy link

melvin-bot bot commented Dec 6, 2023

⚠️ 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.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 6, 2023
@melvin-bot melvin-bot bot changed the title [$500] Fix regressions related to file downloads [HOLD for payment 2023-12-15] [$500] Fix regressions related to file downloads Dec 8, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

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

Copy link

melvin-bot bot commented Dec 8, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.9-5 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 2023-12-15. 🎊

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.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Dec 8, 2023

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:

  • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] 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:
  • [@aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@aimane-chnaif] 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.
  • [] 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 Dec 14, 2023
@aimane-chnaif
Copy link
Contributor

@NikkiWines can you please add Bug label for payment?

@NikkiWines NikkiWines added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Dec 15, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

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

Copy link

melvin-bot bot commented Dec 15, 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 Overdue label Dec 18, 2023
@zanyrenney
Copy link
Contributor

payment summary

@kidroca does not require payment (Contractor) - due $500 elsewhere.
@aimane-chnaif requires payment automatic offer (Reviewer) - PAID $500
no reporting bonus.

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2023
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

6 participants