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

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

Closed
3 of 6 tasks
IuliiaHerets opened this issue Aug 15, 2024 · 16 comments
Closed
3 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 15, 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: 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:

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

Screenshots/Videos

Bug6572688_1723702324289.vh.mp4

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
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 15, 2024
Copy link

melvin-bot bot commented Aug 15, 2024

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
Copy link
Author

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

@IuliiaHerets
Copy link
Author

@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
Copy link
Contributor

FitseTLT commented Aug 15, 2024

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

const plainText = isAnchorTag ? Parser.htmlToMarkdown(content) : Parser.htmlToText(content);
Clipboard.setHtml(content, plainText);

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 melvin-bot bot added the Overdue label Aug 19, 2024
Copy link

melvin-bot bot commented Aug 20, 2024

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

Copy link

melvin-bot bot commented Aug 22, 2024

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

@kevinksullivan kevinksullivan added the External Added to denote the issue can be worked on by a contributor label Aug 24, 2024
Copy link

melvin-bot bot commented Aug 24, 2024

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

@melvin-bot melvin-bot bot changed the title Chat - Copy to clipboard & pasting phone number, shows @expensify.sms after number [$250] Chat - Copy to clipboard & pasting phone number, shows @expensify.sms after number Aug 24, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 24, 2024
Copy link

melvin-bot bot commented Aug 24, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 24, 2024
@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Aug 26, 2024

@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

Copy link

melvin-bot bot commented Aug 26, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 26, 2024
Copy link

melvin-bot bot commented Aug 26, 2024

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

Copy link

melvin-bot bot commented Aug 26, 2024

📣 @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
Copy link
Contributor

created PR in expensify-common and tagged reviewers. 👍

@ZhenjaHorbach
Copy link
Contributor

@kevinksullivan
We are ready for payment !

#48280 (comment)
Снимок экрана 2024-09-11 в 08 53 25

@ZhenjaHorbach
Copy link
Contributor

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:

  • [@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

  • [ @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

  • [@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

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

  • Open App
  • Tap on any report
  • Enter any phone number( for example @+919878675645 )
  • Send the message
  • Long press the message and copy to clipboard
  • Tap plus icon and assign task
  • Paste the message in title field
  • Verify that @expensify.sms doesn't appear at the end of the phone number

Do we agree 👍 or 👎

@kevinksullivan
Copy link
Contributor

All set!

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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: No status
Development

No branches or pull requests

5 participants