Skip to content

[HOLD for payment 2024-07-24] [$250] Group chat - User mention is not copied when copying "made an admin" whisper to clipboard #40477

Description

@m-natarajan

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:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Start chat
  3. Create a group chat with User B.
  4. Send a message to the group chat.
  5. Click on the chat header > Members.
  6. Invite User B.
  7. As User B, go to the group chat.
  8. Right click on the whisper "made @user an admin" > Copy to clipboard.
  9. Paste the content.

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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6453668_1713448661144.20240418_215156.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c22e43e02e5a0415
  • Upwork Job ID: 1785752223998607360
  • Last Price Increase: 2024-06-26
  • Automatic offers:
    • eh2077 | Reviewer | 102966441
    • ahmedGaber93 | Contributor | 102966443
Issue OwnerCurrent Issue Owner: @isabelastisser

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 18, 2024
  2. melvin-bot commented on Apr 18, 2024

    @melvin-bot

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

  3. melvin-bot commented on Apr 18, 2024

    @melvin-bot

    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.

  4. github-actions commented on Apr 18, 2024

    @github-actions
    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.
  5. m-natarajan commented on Apr 18, 2024

    @m-natarajan
    Author

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

  6. m-natarajan commented on Apr 18, 2024

    @m-natarajan
    Author

    We think this bug might be related to #vip-vsb

  7. francoisl commented on Apr 18, 2024

    @francoisl
    Contributor

    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>".

    image

    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.

  8. ahmedGaber93 commented on Apr 18, 2024

    @ahmedGaber93
    Contributor

    Proposal

    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.

    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 rule reportMentions in ExpensiMark

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

    Edit userMention here 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)

  9. 106 remaining items

  10. eh2077 commented on Jul 22, 2024

    @eh2077
    Contributor

    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.
  11. eh2077 commented on Jul 22, 2024

    @eh2077
    Contributor

    @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?

    cc @marcaaron @lakchote

  12. mallenexpensify commented on Jul 22, 2024

    @mallenexpensify
    Contributor

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

  13. eh2077 commented on Jul 22, 2024

    @eh2077
    Contributor

    @mallenexpensify Yes, we can close the other issue #40403.

    Regression test

    1. Open any workspace chat
    2. Send a message contain mention user and mention report and other text @MENTION_USER text after #MENTION_REPORT text after
    3. Right click on the sent message then Copy to clipboard.
    4. Paste the copied text in comopser and Verify the message pasted successfully with mentions

    Do we agree 👍 or 👎

  14. marcaaron commented on Jul 23, 2024

    @marcaaron
    Contributor

    LGTM

  15. mallenexpensify commented on Jul 23, 2024

    @mallenexpensify
    Contributor
  16. eh2077 commented on Jul 27, 2024

    @eh2077
    Contributor

    @mallenexpensify Can you help to issue the payment as discussed here #40477 (comment)

  17. mallenexpensify commented on Jul 30, 2024

    @mallenexpensify
    Contributor

    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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions