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

[$500] Assign task - Completed/reopened task message is not copied in offline mode #27558

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 15, 2023 · 24 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 15, 2023

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


Action Performed:

  1. Login to staging new dot
  2. Turn offline mode on
  3. Go to any chat with a task
  4. Check or uncheck the completed check box
  5. Long press the notifier message that appeared based on your action in step 5 and click on copy to clipboard
  6. Go to composer and try pasting it, observe that the content can not be pasted

Expected Result:

Content should be pasted

Actual Result:

A copied to clipboard confirmation is shown but content is not pasted

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.70-5

Reproducible in staging?: Y

Reproducible in production?: Y

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

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

Notes/Photos/Videos: Any additional supporting documentation

2023_08_29_07_23_17.mp4
Screen_Recording_20230915_194701_Chrome.mp4

Expensify/Expensify Issue URL:

Issue reported by: @SofoniasN

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693283250856049

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b56cf7afa052e5c6
  • Upwork Job ID: 1702762921800577024
  • Last Price Increase: 2023-09-29
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 15, 2023
@melvin-bot melvin-bot bot changed the title Assign task - Completed/reopened task message is not copied in offline mode [$500] Assign task - Completed/reopened task message is not copied in offline mode Sep 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

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

melvin-bot bot commented Sep 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
Copy link

melvin-bot bot commented Sep 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@ayazalavi
Copy link
Contributor

Proposal

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

Copy and paste is not working over the web.

What is the root cause of that problem?

https://necolas.github.io/react-native-web/docs/clipboard/

This plugin is not properly supported over the web.

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

Update package with the one supporting both react native and web. e.g. use navigator.clipboard api over the web and use clipboard plugin for apps.

What alternative solutions did you explore? (Optional)

clipboard.js supports the web

@ewanmellor
Copy link

Proposal

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

Copy-and-paste through the context menu is broken for "completed task" and "reopened task" notifications.

What is the root cause of that problem?

In BaseReportActionContextMenu, type="REPORT_ACTION" but reportAction={}. In ContextMenuActions this results in shouldShow returning true but the onPress handler does nothing.

The root cause assessment from @ayazalavi is incorrect.

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

  1. Change the ContextMenuAction to handle the case where the action is unknown (the button should not be on the action toolbar if it won't do anything).
  2. Pass the notification details through in this case, so that the message can be correctly copied.

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

📣 @ewanmellor! 📣
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. 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.
  2. 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.
  3. 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>

@ewanmellor
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01db74ce3e7227751d

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@jliexpensify jliexpensify removed their assignment Sep 16, 2023
@jliexpensify
Copy link
Contributor

Unassigning myself as Maddy was the first B0 member assigned.

@hoangzinh
Copy link
Contributor

hoangzinh commented Sep 16, 2023

Proposal

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

Assign task - Completed/reopened task message is not copied in offline mode

What is the root cause of that problem?

In the Copy to clipboard handler, if it's a Task report action, we will gonna get the content inside of reportAction.originalMessage.html

const originalMessage = _.get(reportAction, 'originalMessage', {});
const messageHtml = isTaskAction ? lodashGet(originalMessage, 'html', '') : lodashGet(message, 'html', '');

But when we build optimistic data for a Task report action, we haven't set the html data for originalMessage yet

App/src/libs/ReportUtils.js

Lines 2308 to 2312 in 76c1559

const originalMessage = {
taskReportID,
type: actionName,
text: message,
};

=> Nothing data to copy

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

In the util to build optimistic data for a Task report action, we need to set html: message in those LOC as well

App/src/libs/ReportUtils.js

Lines 2308 to 2312 in 76c1559

const originalMessage = {
taskReportID,
type: actionName,
text: message,
};

Moreover, in online mode, I found that we are unable to copy the Task report action message too. I think it's BE root cause. Because it's out of scope here so I will explain the expand block below.

RCA in online mode

BE set childReportID (and other childReport data for those system messages), which is incorrect because it doesn't have any child thread
Screenshot 2023-09-16 at 18 46 49

Thus, we get incorrect originial report id here

App/src/libs/ReportUtils.js

Lines 3290 to 3292 in 76c1559

function getOriginalReportID(reportID, reportAction) {
return isThreadFirstChat(reportAction, reportID) ? lodashGet(allReports, [`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, 'parentReportID']) : reportID;
}

Thus, we get incorrect list reportActions here

reportActions: {
key: ({originalReportID}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${originalReportID}`,
canEvict: false,
},

=> Could not found reportAction in those LOC

const reportAction = useMemo(() => {
if (_.isEmpty(props.reportActions) || props.reportActionID === '0') return {};
return props.reportActions[props.reportActionID] || {};
}, [props.reportActions, props.reportActionID]);

=> Unable to copy in online mode

We can fix it in FE by checking if it's report action in this util getOriginalReportID, but I think it's better if it's fixed in BE because those report action doesn't have any child thread

@ayazalavi
Copy link
Contributor

@everyone Can you guys paste videos showing your solution working in android mobile web? I am pretty sure docs clearly says react-native-web clipboard is having issues over the web.

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2023
@maddylewis
Copy link
Contributor

@jjcoffee will review proposals once he has a chance

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2023
@maddylewis maddylewis added Weekly KSv2 and removed Daily KSv2 labels Sep 18, 2023
@jjcoffee
Copy link
Contributor

Can't repro this on latest main, I believe it was fixed in #27119.

@SofoniasN
Copy link

Hey @maddylewis as this was a legitimate bug, i think i should be eligible for reporter bonus even if it was fixed by another PR. TIA

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

@jjcoffee @maddylewis 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 Daily KSv2 Overdue and removed Weekly KSv2 Overdue labels Sep 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@maddylewis
Copy link
Contributor

kk, i'll issue $50 reporting bonus to @SofoniasN, but this was fixed via #27119. I'll close once payment is processed to the reporter.

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@maddylewis
Copy link
Contributor

offer sent

@SofoniasN
Copy link

Offer accepted

@maddylewis
Copy link
Contributor

paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

8 participants