Repository navigation
[HOLD for payment 2024-07-24] [$250] Group chat - User mention is not copied when copying "made an admin" whisper to clipboard #40477
Description
Activity
- addedDeployBlockerCashThis issue or pull request should block deploymentThis issue or pull request should block deploymentDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Apr 18, 2024 Triggered auto assignment to @francoisl (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.Triggered auto assignment to @isabelastisser (
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.github-actions commented
on Apr 18, 2024 on Apr 18, 2024 – with GitHub ActionsContributorMore actions👋 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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
@isabelastisser FYI 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.
We think this bug might be related to #vip-vsb
I feel like this has to do more with how we copy text from mentions specifically, because the message is in the format
"<muted-text>made <mention-user accountID=NNN></mention-user> an admin</muted-text>".
Not sure it needs to be a blocker as it doesn't stop you from doing anything critical though.
In the meantime, cc @puneetlath if you have any idea off the top of your head what this could be from.Reacted by Marc GlasserProposal
Please re-state the problem that we are trying to solve in this issue.
Group chat - User mention is not copied when copying "made an admin" whisper to clipboard
What is the root cause of that problem?
When We copy
<mention-user accountID="1234" />as HTML to clipboard in the web here.
App/src/libs/Clipboard/index.ts
Lines 119 to 123 in 571a79d
new ClipboardItem({ /* eslint-disable @typescript-eslint/naming-convention */ 'text/html': new Blob([html], {type: 'text/html'}), 'text/plain': new Blob([text], {type: 'text/plain'}), }),
the paste value here paste with different format<meta charset='utf-8'><html><head></head><body><mention-user accountid="1234"></mention-user></body></html>(<openTag></closeTag>not<closedTag />), and this format not match rulereportMentionsinExpensiMarkWhat changes do you think we should make in order to solve the problem?
Edit
userMentionhere to match both<closedTag />and<openTag></closeTag>// regex: /<mention-user accountID="(\d+)" *\/>/gi, regex: /<mention-user accountID="(\d+)"(?: *\/>|><\/mention-user>)/gi,we will do the same for #40403
// regex: /<mention-report reportID="(\d+)" *\/>/gi, regex: /<mention-report reportID="(\d+)"(?: *\/>|><\/mention-report>)/gi,What alternative solutions did you explore? (Optional)
106 remaining items
Checklist
- [@eh2077] The PR that introduced the bug has been identified. Link to the PR: I can't figure out the specific PR caused this bug. We have waited for a while to get this fixed based on this feat
- [@eh2077] 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: N/A
- [@eh2077] 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: N/A
- [@eh2077] Determine if we should create a regression test for this bug. No, as we have unit tests to cover it.
@isabelastisser I think you can handle the payment together with #40403 because we fixed them together here. The bounty should be $250 + $250 = $500 as mentioned earlier, see #40477 (comment)
We can still treat them like two separate bugs (and get paid for both) - but let's work on the solution a bit more. @ahmedGaber93 What do you think about that?
@eh2077 is there any reason to keep the other issue open? Possibly we need a regression test for that use flow?
If not, lit seems best to close that one and manage payment ($500/each) here.@mallenexpensify Yes, we can close the other issue #40403.
Regression test
- Open any workspace chat
- Send a message contain mention user and mention report and other text
@MENTION_USER text after #MENTION_REPORT text after - Right click on the sent message then Copy to clipboard.
- Paste the copied text in comopser and Verify the message pasted successfully with mentions
Do we agree 👍 or 👎
Reacted by Marc GlasserLGTM
Thanks @eh2077, issue closed, Test case created
@mallenexpensify Can you help to issue the payment as discussed here #40477 (comment)
Contributor: @ahmedGaber93 paid $500 via Upwork
Contributor+: @eh2077 paid $500 via Upwork.@eh2077 thanks for the reminder, sorry I missed this (likely thought payment was via the other issue)
Reacted by Eric Han
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?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: n/a
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:
Action Performed:
Expected Result:
The user mention in the whisper is copied.
Actual Result:
The user mention in the whisper is not copied.
The user mention is also missing in LHN.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6453668_1713448661144.20240418_215156.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @isabelastisser