Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.32k stars 2.76k forks source link

[$250] Chat - Copy to clipboard & pasting phone number, shows @expensify.sms after number #47484

Closed IuliiaHerets closed 6 hours ago

IuliiaHerets commented 4 weeks ago

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: 9.0.20 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap on a report
  3. Enter eg : @+919878675645
  4. Send the message
  5. Long press the message and copy to clipboard
  6. Tap plus icon -- assign task
  7. Paste in title field

Expected Result:

Copy to clipboard and pasting phone number, must not show @expensify.sms after number.

Actual Result:

Copy to clipboard and pasting phone number, shows @expensify.sms after number.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/38faca5c-1151-446e-a781-fb6785ea218d

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e408113871c83775
  • Upwork Job ID: 1827401422870562005
  • Last Price Increase: 2024-08-24
  • Automatic offers:
    • ZhenjaHorbach | Reviewer | 103688903
    • FitseTLT | Contributor | 103688906
Issue OwnerCurrent Issue Owner: @ZhenjaHorbach
melvin-bot[bot] commented 4 weeks ago

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

IuliiaHerets commented 4 weeks ago

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

IuliiaHerets commented 4 weeks ago

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

FitseTLT commented 4 weeks ago

Edited by proposal-police: This proposal was edited at 2024-08-15 11:38:39 UTC.

Proposal

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

Copy to clipboard & pasting phone number, shows @expensify.sms after number

What is the root cause of that problem?

We forgot to remove sms domain for the text here https://github.com/Expensify/App/blob/d4d5a2586910ff46147219ee3e98bb3e936f8037/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L52-L53 and htmlToText by default doesn't remove sms domains

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

We need to update our expensify-common lib, that is, we need to remove sms domain for htmlToText case same as we do for htmlToMarkdown here So we need to change code here to

                    return `@${Str.removeSMSDomain(extras.accountIDToName?.[g1]?? '') }`;

What alternative solutions did you explore? (Optional)

We need to remove the sms domain

function setClipboardMessage(content: string) {
    if (!Clipboard.canSetHtml()) {
        Clipboard.setString(Str.removeSMSDomain(Parser.htmlToMarkdown(content)));
    } else {
        const anchorRegex = CONST.REGEX_LINK_IN_ANCHOR;
        const isAnchorTag = anchorRegex.test(content);
        const plainText = isAnchorTag ? Parser.htmlToMarkdown(content) : Parser.htmlToText(content);
        Clipboard.setHtml(content, Str.removeSMSDomain(plainText));
    }
}

or only apply the removing to htmlToText cases as htmlToMarkdown properly removes the sms domain alternatively We can also take the cleaning code to Clipboard.setHtml and setString

melvin-bot[bot] commented 3 weeks ago

@kevinksullivan Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 3 weeks ago

@kevinksullivan Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

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

ZhenjaHorbach commented 2 weeks ago

@FitseTLT Thank you for your proposal ! I like your main solution and I agree that we need to update userMention rule So I'm happy to go with this proposal

🎀👀🎀 C+ reviewed

melvin-bot[bot] commented 2 weeks ago

Triggered auto assignment to @aldo-expensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 2 weeks ago

📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 2 weeks ago

📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

FitseTLT commented 2 weeks ago

created PR in expensify-common and tagged reviewers. 👍

ZhenjaHorbach commented 1 day ago

@kevinksullivan We are ready for payment !

https://github.com/Expensify/App/pull/48280#issuecomment-2327618578

Снимок экрана 2024-09-11 в 08 53 25
ZhenjaHorbach commented 1 day ago

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:

  • [x] [@ZhenjaHorbach] The PR that introduced the bug has been identified. Link to the PR:

It's more like a new feature Since now htmlToText removes sms domains by default as we do for htmlToMarkdown

  • [x] [ @ZhenjaHorbach] 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:

NA

  • [x] [@ZhenjaHorbach] 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

  • [x] [@ZhenjaHorbach] Determine if we should create a regression test for this bug.
  • [x] [@ZhenjaHorbach] 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.

Regression Test Proposal

Do we agree 👍 or 👎

kevinksullivan commented 6 hours ago

All set!