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

Open
6 tasks done
izarutskaya opened this issue Apr 18, 2024 · 41 comments
Assignees
Labels
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 contributors@expensify.com 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-05-16
@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
@melvin-bot melvin-bot bot added the Overdue label May 6, 2024
@lakchote
Copy link
Contributor

lakchote commented May 6, 2024

@Santhosh-Sellavel can you take a look at recent comments from @ahmedGaber93 please?

@melvin-bot melvin-bot bot removed the Overdue label May 6, 2024
@eh2077
Copy link
Contributor

eh2077 commented May 6, 2024

@lakchote We can put this on hold as discussed here #40477 (comment). We can have a holistic solution to fix them together.

@marcaaron
Copy link
Contributor

marcaaron commented May 7, 2024

@ahmedGaber93 do you think you could drop into the other issue a Problem & Solution statement that summarizes both of these very similar issues and present the holistic plan to fix them?

@ahmedGaber93
Copy link
Contributor

@ahmedGaber93 do you think you could drop into #40477 (comment) a Problem & Solution statement that summarizes both of these very similar issues and present the holistic plan to fix them?

@marcaaron Yes I agree, these are two implementations for one feature, and fixing them together will facilitate the process of testing and discover the possible bugs and fix it.

@melvin-bot melvin-bot bot added the Overdue label May 8, 2024
Copy link

melvin-bot bot commented May 9, 2024

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

Copy link

melvin-bot bot commented May 9, 2024

@JmillsExpensify, @lakchote, @Santhosh-Sellavel Whoops! This issue is 2 days overdue. Let's get this updated quick!

@eh2077
Copy link
Contributor

eh2077 commented May 10, 2024

I added a summary here #40477 (comment)

Copy link

melvin-bot bot commented May 13, 2024

@JmillsExpensify, @lakchote, @Santhosh-Sellavel Still overdue 6 days?! Let's take care of this!

@eh2077
Copy link
Contributor

eh2077 commented May 13, 2024

We have updates on the other issue.

@JmillsExpensify
Copy link

Thanks, yes updated on the other issue.

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2024
Copy link

melvin-bot bot commented May 16, 2024

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

Copy link

melvin-bot bot commented May 16, 2024

@JmillsExpensify @lakchote @Santhosh-Sellavel this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added the Overdue label May 17, 2024
@JmillsExpensify
Copy link

Based on the above discussion, should we close this issue or leave it open?

@melvin-bot melvin-bot bot removed the Overdue label May 19, 2024
@lakchote
Copy link
Contributor

Based on the above discussion, should we close this issue or leave it open?

Looking at latest @eh2077's comment, we could put this on hold for #40565 to keep track of the issue, and revisit once it's merged?

@JmillsExpensify
Copy link

Fine putting it on Hold for now. That PR is being actively worked on.

@JmillsExpensify JmillsExpensify changed the title [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention [HOLD #40565] [$250] Room - Room mention is not copied to clipboard and editor is empty when editing room mention May 20, 2024
@melvin-bot melvin-bot bot added the Overdue label May 22, 2024
@JmillsExpensify JmillsExpensify added Weekly KSv2 and removed Daily KSv2 labels May 22, 2024
@melvin-bot melvin-bot bot removed the Overdue label May 22, 2024
@JmillsExpensify
Copy link

Moved to weekly given the hold

@melvin-bot melvin-bot bot added the Overdue label May 31, 2024
@JmillsExpensify
Copy link

Still on hold.

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2024
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. 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
Development

No branches or pull requests

7 participants