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-07-24] [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention #40403

Closed
6 tasks done
izarutskaya opened this issue Apr 18, 2024 · 54 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering 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 Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Apr 18, 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: 1.4.63-0
Reproducible in staging?: Y
Reproducible in production?: N
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Precondition:

  • User has created a few rooms linked to the same workspace.
  1. Go to staging.new.expensify.com
  2. Go to any room from the precondition.
  3. Type # and select a room.
  4. Send the message.
  5. Right click on the message > Copy to clipboard.
  6. Paste the content.
  7. Right click on the message > Edit comment.

Expected Result:

In Step 5, the room in the message will be copied.
In Step 7. the room in the editor will be preserved.

Actual Result:

In Step 5, the room in the message is not copied.
In Step 7. the room in the editor is missing.

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

Bug6453285_1713425267404.room_mention.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c98cde11a4c25f4e
  • Upwork Job ID: 1780934156183453696
  • Last Price Increase: 2024-07-10
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

Copy link

melvin-bot bot commented Apr 18, 2024

Triggered auto assignment to @lakchote (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 18, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@izarutskaya
Copy link
Author

@JmillsExpensify 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.

@izarutskaya
Copy link
Author

We think this issue might be related to the #collect project.

@lakchote lakchote added 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 and removed DeployBlockerCash This issue or pull request should block deployment labels Apr 18, 2024
@melvin-bot melvin-bot bot changed the title Room - Room mention is not copied to clipboard and editor is empty when editing room mention [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

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

Copy link

melvin-bot bot commented Apr 18, 2024

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

@lakchote
Copy link
Contributor

lakchote commented Apr 18, 2024

Not a blocker - it's an edge case that only concer room mentions, no core customer functionality is broken.

@lakchote lakchote added Daily KSv2 and removed Hourly KSv2 labels Apr 18, 2024
@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Apr 18, 2024

Proposal

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

Room - Room mention is not copied to clipboard and editor is empty when editing room mention

What is the root cause of that problem?

we don't handle mention-report in ContextMenuActions.tsx after copy to clipboard pressed, we only handle mention-user

content.replace(/(<mention-user>)(.*?)(<\/mention-user>)/gi, (match, openTag, innerContent, closeTag): string => {
const modifiedContent = Str.removeSMSDomain(innerContent) || '';
return openTag + modifiedContent + closeTag || '';
}),

before sending mention report text to backend we format it to be like this <mention-report>#reportName<mention-report/>
but the message html come from backend with this format <mention-report reportID="1234" /> and this format will return empty text after parsing it to text before add it to clipboard here

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

we need to handle mention-report in ContextMenuActions.tsx with the same way we used it in mention-user.

to copy the orignal message we need to catch reportID from <mention-report reportID="1234" />, and get reportName then revert it to orignal format before send <mention-report>#reportName<mention-report/>.

for that we need to add this extra replace here

.replace(/<mention-report reportID="(\d*)"\/>/gi, (match, reportID): string => {
   const report = getReport(reportID);

   return `<mention-report>${report?.reportName ?? report?.displayName}<mention-report/>`;
})

and setClipboardMessage will parse the orignal message html and get the massage text and add it to Clipboard

function setClipboardMessage(content: string) {
const parser = new ExpensiMark();
if (!Clipboard.canSetHtml()) {
Clipboard.setString(parser.htmlToMarkdown(content));
} else {
const plainText = parser.htmlToText(content);
Clipboard.setHtml(content, plainText);
}
}

What alternative solutions did you explore? (Optional)

@lakchote
Copy link
Contributor

@JmillsExpensify I'll be OOO next week until April 29th. Feel free to assign another internal engineer to review if needed.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 21, 2024

Roomname is copied successfully, but the editor is still empty while editing the room mention

Screen.Recording.2024-04-22.at.1.42.30.AM.mov

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

Interesting, let's keep this open then

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2024
@JmillsExpensify
Copy link

Looks like the related issue is now merged, so removing the hold.

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2024
@JmillsExpensify JmillsExpensify changed the title [HOLD #40565] [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention Jun 19, 2024
Copy link

melvin-bot bot commented Jun 19, 2024

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

1 similar comment
Copy link

melvin-bot bot commented Jun 26, 2024

📣 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 Jun 27, 2024
@lakchote
Copy link
Contributor

lakchote commented Jul 1, 2024

@eh2077 the related PR #40565 that we were waiting for was merged, but it did not solve the issue.

@melvin-bot melvin-bot bot removed the Overdue label Jul 1, 2024
@eh2077
Copy link
Contributor

eh2077 commented Jul 1, 2024

@lakchote Yes, I pinged @ahmedGaber93 here #40477 (comment). I think it still makes sense to solve it together with #40477

Copy link

melvin-bot bot commented Jul 3, 2024

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

@eh2077
Copy link
Contributor

eh2077 commented Jul 3, 2024

We're fixing this together with #40477 - waiting for the PR from @ahmedGaber93

@JmillsExpensify
Copy link

Looks like we're waiting on the related App PR, though I'll go ahead and keep this issue as is because it shouldn't be too much longer.

@melvin-bot melvin-bot bot removed the Overdue label Jul 9, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

📣 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 Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 11, 2024
@melvin-bot melvin-bot bot changed the title [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention [HOLD for payment 2024-07-24] [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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-07-24. 🎊

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

Copy link

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

  • [@lakchote] The PR that introduced the bug has been identified. Link to the PR: Fix copy and paste text inconsistent on mWeb #13396
  • [@lakchote] 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: the offending PR has been created a long time ago (December 2022), it didn't cause bugs until then we were compliant with what was expected in ExpensiMark. The issue arised when we didn't comply with the format expected by the rule reportMentions. As such, it didn't introduce the bug per se.
  • [@lakchote] 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: NA, same reason as above.
  • [@Santhosh-Sellavel] Determine if we should create a regression test for this bug.
  • [@Santhosh-Sellavel] 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.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@mallenexpensify
Copy link
Contributor

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. Engineering 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 Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

8 participants