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 2022-06-13] [$250] mWeb - Chat - Drawer does not close after tapping download file #8942

Closed
kbecciv opened this issue May 11, 2022 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@kbecciv
Copy link

kbecciv commented May 11, 2022

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


Action Performed:

  1. Go https://staging.new.expensify.com/
  2. Log in with any account
  3. Find the chat where you can download the file
  4. Hold the finger on any type of file (mp4, png., mov)
  5. Tap download

Expected Result:

Drawer is closing after tapping download file.

Actual Result:

Drawer not closing after tapping download file. Drawer closes for other options but not for the download one

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Mobile Web

Version Number: 1.1.57.12

Reproducible in staging?: Yes

Reproducible in production?: No 9new feature)

Email or phone of affected tester (no customers): any

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Screen_Recording_20220511-100037_Chrome.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause

Slack conversation:

View all open jobs on GitHub

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2022

Triggered auto assignment to @yuwenmemon (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@sobitneupane
Copy link
Contributor

Proposal
This issue is occurring in web as well. Addition of following lines of code should solve the issue.

onPress: (closePopover, {reportAction}) => {
const message = _.last(lodashGet(reportAction, 'message', [{}]));
const html = lodashGet(message, 'html', '');
const attachmentDetails = getAttachmentDetails(html);
const {originalFileName} = attachmentDetails;
let {sourceURL} = attachmentDetails;
sourceURL = addEncryptedAuthTokenToURL(sourceURL);
fileDownload(sourceURL, originalFileName);
},

        onPress: (closePopover, {reportAction}) => {
            const message = _.last(lodashGet(reportAction, 'message', [{}]));
            const html = lodashGet(message, 'html', '');
            const attachmentDetails = getAttachmentDetails(html);
            const {originalFileName} = attachmentDetails;
            let {sourceURL} = attachmentDetails;
            sourceURL = addEncryptedAuthTokenToURL(sourceURL);
            fileDownload(sourceURL, originalFileName);
+          if (closePopover) {
+              hideContextMenu(true, ReportActionComposeFocusManager.focus);
+          }
        },

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2022

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

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2022

@yuwenmemon Eep! 4 days overdue now. Issues have feelings too...

@yuwenmemon yuwenmemon added the External Added to denote the issue can be worked on by a contributor label May 18, 2022
@yuwenmemon yuwenmemon removed their assignment May 18, 2022
@melvin-bot
Copy link

melvin-bot bot commented May 18, 2022

Triggered auto assignment to @stephanieelliott (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@stephanieelliott
Copy link
Contributor

Posted to Upwork: https://www.upwork.com/jobs/~01a4a5d881f891960a

@melvin-bot
Copy link

melvin-bot bot commented May 20, 2022

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 20, 2022
@melvin-bot
Copy link

melvin-bot bot commented May 20, 2022

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

@melvin-bot melvin-bot bot changed the title mWeb - Chat - Drawer not closing after tapping download file [$250] mWeb - Chat - Drawer not closing after tapping download file May 20, 2022
@stephanieelliott
Copy link
Contributor

Heads up, @neil-marcellini and @rushatgabhane we have a proposal for this already here.

@jayeshmangwani
Copy link
Contributor

Proposal:

we can call hideContextMenu on fileDownload promise is finally either fulfilled or rejected,

onPress: (closePopover, {reportAction}) => {
const message = _.last(lodashGet(reportAction, 'message', [{}]));
const html = lodashGet(message, 'html', '');
const attachmentDetails = getAttachmentDetails(html);
const {originalFileName} = attachmentDetails;
let {sourceURL} = attachmentDetails;
sourceURL = addEncryptedAuthTokenToURL(sourceURL);
fileDownload(sourceURL, originalFileName);
},

onPress: (closePopover, {reportAction}) => { 
     const message = _.last(lodashGet(reportAction, 'message', [{}])); 
     const html = lodashGet(message, 'html', ''); 
     const attachmentDetails = getAttachmentDetails(html); 
     const {originalFileName} = attachmentDetails; 
     let {sourceURL} = attachmentDetails; 
     sourceURL = addEncryptedAuthTokenToURL(sourceURL); 
-    fileDownload(sourceURL, originalFileName);
+    fileDownload(sourceURL, originalFileName)
+                .finally(()=> hideContextMenu(true, ReportActionComposeFocusManager.focus));

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 20, 2022
@rushatgabhane
Copy link
Member

🎀 👀 🎀 C+ reviewed
@yuwenmemon I like @sobitneupane's proposal. I don't see why we should wait for the promise to be resolved. We prefer optimistic UI changes.

P. S. @sobitneupane do we really need to check this condition? if (closePopover). Please make sure to explain why this is or isn't required in the PR. Thanks

@neil-marcellini
Copy link
Contributor

I agree with @rushatgabhane that @sobitneupane has a good proposal. Personally I think we should check if (closePopover), but I'm also curious to hear your explanation.

@sobitneupane
Copy link
Contributor

closePopover is false only for MiniReportActionContextMenu which remains active as long as mouse is hovered over the message.
Screen Shot 2022-05-24 at 17 32 56

With the condition check, we are avoiding unnecessary call of hideContextMenu as MiniReportActionContextMenu remains active as long as message is being hovered.

@neil-marcellini
Copy link
Contributor

@sobitneupane Thanks for your explanation. I will assign you to this issue and I look forward to reviewing your PR.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 24, 2022
@melvin-bot
Copy link

melvin-bot bot commented May 24, 2022

📣 @sobitneupane You have been assigned to this job by @neil-marcellini!
Please apply to this job in Upwork 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 📖

@stephanieelliott
Copy link
Contributor

Hey @sobitneupane, can you apply to the job on Upwork when you get a chance? https://www.upwork.com/jobs/~01a4a5d881f891960a

@sobitneupane
Copy link
Contributor

Hey @sobitneupane, can you apply to the job on Upwork when you get a chance? https://www.upwork.com/jobs/~01a4a5d881f891960a

Applied.

@kbecciv kbecciv changed the title [$250] mWeb - Chat - Drawer not closing after tapping download file [$250] mWeb - Chat - Drawer does not close after tapping download file May 28, 2022
@melvin-bot melvin-bot bot added the Overdue label May 28, 2022
@neil-marcellini
Copy link
Contributor

PR is under review now.

@melvin-bot melvin-bot bot removed the Overdue label May 31, 2022
@neil-marcellini neil-marcellini added the Reviewing Has a PR in review label May 31, 2022
@stephanieelliott
Copy link
Contributor

PR is on staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 6, 2022
@melvin-bot melvin-bot bot changed the title [$250] mWeb - Chat - Drawer does not close after tapping download file [HOLD for payment 2022-06-13] [$250] mWeb - Chat - Drawer does not close after tapping download file Jun 6, 2022
@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2022

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.71-2 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 2022-06-13. 🎊

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 12, 2022
@stephanieelliott
Copy link
Contributor

All paid, thank you!

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 Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants