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-08-05] [$250] Web - Attachment - Downloads can be requested continuously while the file is still loading #43546

Closed
4 of 6 tasks
izarutskaya opened this issue Jun 12, 2024 · 36 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

@izarutskaya
Copy link

izarutskaya commented Jun 12, 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: v1.4.82-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): nhut.nguyenminh.it+dt002@gmail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Open any conversation have attachment
  2. Click on download
  3. Right click > Click on download multi times

Expected Result:

When the file is being downloaded, the download button inside the right-click menu must also be disabled to avoid users being able to click repeatedly to download the file.

Actual Result:

When clicking download, the download button will change to a loading button and the user cannot click on it, however, the download button in the right-click menu is not disabled and the user can click continuously and download repeatedly.

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

Bug6474921_1715180171795.Untitled_Project.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015a422bd93974d7e4
  • Upwork Job ID: 1803174728471774019
  • Last Price Increase: 2024-06-25
  • Automatic offers:
    • situchan | Reviewer | 102939368
    • nkdengineer | Contributor | 102939370
Issue OwnerCurrent Issue Owner: @anmurali
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

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

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb

@devguest07
Copy link
Contributor

Proposal

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

The user is able to trigger a download when the file is already downloading.

What is the root cause of that problem?

In the Context menu, we do not display the Download button based on the download state. The file can be downloaded, and the download link will still appear on the context menu.

shouldShow: (type, reportAction, isArchivedRoom, betas, menuTarget, isChronosReport, reportID, isPinnedChat, isUnreadChat, isOffline): reportAction is ReportAction => {
const isAttachment = ReportActionsUtils.isReportActionAttachment(reportAction);
const messageHtml = getActionHtml(reportAction);
return (
isAttachment && messageHtml !== CONST.ATTACHMENT_UPLOADING_MESSAGE_HTML && !!reportAction?.reportActionID && !ReportActionsUtils.isMessageDeleted(reportAction) && !isOffline
);
},

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

In BaseAnchorForAttachmentsOnly, we have an isDownloading variable used to prevent the click action on the file when downloading.

const isDownloading = download?.isDownloading ?? false;

We can use the same isDownloading variable and pass it to showContextMenuForReport.

onLongPress={(event) => showContextMenuForReport(event, anchor, report?.reportID ?? '', action, checkIfContextMenuActive, ReportUtils.isArchivedRoom(report))}

In ContextMenuActions, we can add another condition to shouldShow to prevent the display when isDownloading.

shouldShow: (type, reportAction, isArchivedRoom, betas, menuTarget, isChronosReport, reportID, isPinnedChat, isUnreadChat, isOffline): reportAction is ReportAction => {
const isAttachment = ReportActionsUtils.isReportActionAttachment(reportAction);
const messageHtml = getActionHtml(reportAction);
return (
isAttachment && messageHtml !== CONST.ATTACHMENT_UPLOADING_MESSAGE_HTML && !!reportAction?.reportActionID && !ReportActionsUtils.isMessageDeleted(reportAction) && !isOffline
);
},

What alternative solutions did you explore?

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

melvin-bot bot commented Jun 17, 2024

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

@anmurali anmurali added the External Added to denote the issue can be worked on by a contributor label Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

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

@melvin-bot melvin-bot bot changed the title Web - Attachment - Downloads can be requested continuously while the file is still loading [$250] Web - Attachment - Downloads can be requested continuously while the file is still loading Jun 18, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 18, 2024
Copy link

melvin-bot bot commented Jun 18, 2024

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Jun 19, 2024

Proposal

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

The download button in the right-click menu is not disabled and the user can click continuously and download repeatedly.

What is the root cause of that problem?

In AnchorForAttachmentsOnly as shown in the OP video

shouldShowLoadingSpinnerIcon={isDownloading}

It will show the loading icon if the attachment is downloading, it will also do not allow further download trigger

However, we don't have any implementation to disable the Download button in the report action context menu when the attachment is downloading

onPress: (closePopover, {reportAction}) => {

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

Add implementation to disable the Download button in the report action context menu when the attachment is downloading.

shouldDisable: (download) => {
    return download?.isDownloading ?? false
}
const html = getActionHtml(reportAction);
const {sourceURL} = getAttachmentDetails(html);
const sourceID = (sourceURL?.match(CONST.REGEX.ATTACHMENT_ID) ?? [])[1];

const [download] = useOnyx(`${ONYXKEYS.COLLECTION.DOWNLOAD}${sourceID}`);

(getActionHtml should be exported from src/pages/home/report/ContextMenu/ContextMenuActions.tsx)

disabled={contextAction?.shouldDisable ? contextAction?.shouldDisable(download) : false}
disabled={disabled}
  • Optional: Customize the cursor to be cursor: wait so it's clear it's disabled because it is loading. Or we can go further by customizing the icon of the Download context menu item to use loading indicator while the attachment is downloading. Like the UX of AnchorForAttachmentsOnly

Result:

Screen.Recording.2024-06-19.at.2.34.45.PM.mov

What alternative solutions did you explore? (Optional)

Other UXs can be suggested: Changing the action menu text to Downloading when it's downloading, ...

The problem could exist in similar case such as mini context menu, ... can be fixed like described.

@situchan
Copy link
Contributor

@devguest07 can you please share demo video after applying your solution?

@situchan
Copy link
Contributor

If I understand correctly, @devguest07 suggested to hide Download button, while @nkdengineer suggested to disable Download button.

@Expensify/design which pattern is correct? hide or disable?

@shawnborton
Copy link
Contributor

Hmm I would think we would replace the icon in the right click menu's Download row with a loading spinner as well.

That being said, this is an edge-case, I doubt real users are going to be doing this action.

@dannymcclain
Copy link
Contributor

Hmm I would think we would replace the icon in the right click menu's Download row with a loading spinner as well.

Yeah I'd say disable + replace icon with loading spinner. But I also agree with that this is an edge-case.

@nkdengineer
Copy link
Contributor

Yeah I'd say disable + replace icon with loading spinner.

@situchan Looks like everyone agrees to go with my suggestion, I think we're good to move forward here

Add implementation to disable the Download button in the report action context menu when the attachment is downloading.

Or we can go further by customizing the icon of the Download context menu item to use loading indicator while the attachment is downloading. Like the UX of AnchorForAttachmentsOnly

@shawnborton
Copy link
Contributor

That being said, if we do decide to keep this one open, let's lower the bug bounty because it's such an edge case that not a single customer has ever reported yet.

Copy link

melvin-bot bot commented Jun 24, 2024

@anmurali, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@situchan
Copy link
Contributor

disable + replace icon with loading spinner

@nkdengineer's proposal looks good based on expected behavior we discussed.

🎀👀🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Jun 25, 2024
Copy link

melvin-bot bot commented Jun 25, 2024

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

Copy link

melvin-bot bot commented Jun 26, 2024

@madmax330 @anmurali @situchan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Weekly KSv2 label Jul 4, 2024
@nkdengineer
Copy link
Contributor

@situchan this PR is ready for review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] Web - Attachment - Downloads can be requested continuously while the file is still loading [HOLD for payment 2024-08-05] [$250] Web - Attachment - Downloads can be requested continuously while the file is still loading Jul 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

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

Copy link

melvin-bot bot commented Jul 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.13-4 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-08-05. 🎊

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

Copy link

melvin-bot bot commented Jul 29, 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:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] 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:
  • [@situchan] 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:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] 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.
  • [@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Jul 29, 2024
Copy link

melvin-bot bot commented Jul 29, 2024

This issue has not been updated in over 15 days. @madmax330, @anmurali, @situchan, @nkdengineer 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 Monthly KSv2 Daily KSv2 and removed Monthly KSv2 labels Jul 29, 2024
@melvin-bot melvin-bot bot added the Overdue label Aug 7, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

@madmax330, @anmurali, @situchan, @nkdengineer Whoops! This issue is 2 days overdue. Let's get this updated quick!

@situchan
Copy link
Contributor

situchan commented Aug 8, 2024

Waiting for payment
cc: @anmurali

Copy link

melvin-bot bot commented Aug 12, 2024

@madmax330, @anmurali, @situchan, @nkdengineer 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@anmurali
Copy link

@situchan can you please propose a regression test and otherwise complete the BZ checklist first?
@nkdengineer is paid.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 14, 2024
@situchan
Copy link
Contributor

This is not regression but improvement.
I think we can skip regression test as edge case.

Copy link

melvin-bot bot commented Aug 19, 2024

@madmax330, @anmurali, @situchan, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Aug 21, 2024

@madmax330, @anmurali, @situchan, @nkdengineer 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Aug 23, 2024

@madmax330, @anmurali, @situchan, @nkdengineer Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

Copy link

melvin-bot bot commented Aug 27, 2024

@madmax330, @anmurali, @situchan, @nkdengineer 12 days overdue now... This issue's end is nigh!

@anmurali
Copy link

Paid.

@melvin-bot melvin-bot bot removed the Overdue label Aug 28, 2024
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
No open projects
Status: No status
Development

No branches or pull requests

8 participants