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

[PAID] [$1000] Emoji-only Anchor Text with Hyperlink is accepted/doesn't look right #18386

Closed
1 of 6 tasks
kavimuru opened this issue May 4, 2023 · 36 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented May 4, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open a chat and put an emoji inside of square brackets "[]" and put a link inside of parenthesis "()" and post the comment

Expected Result:

Emoji only should not be accepted as an anchor text or it should look right

Actual Result:

Emoji only is accepted as an anchor text and it doesn't look pleasing to the eye

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.9.16
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

2023-05-03.13.37.01.mp4

1

Expensify/Expensify Issue URL:
Issue reported by: @Nathan-Mulugeta
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683110677125259

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016f4e82bec390b3ae
  • Upwork Job ID: 1656089549211725824
  • Last Price Increase: 2023-05-10
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 4, 2023
@MelvinBot
Copy link

Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@strepanier03
Copy link
Contributor

strepanier03 commented May 5, 2023

Raised internally for discussion on path forward.

@melvin-bot melvin-bot bot added the Overdue label May 8, 2023
@strepanier03
Copy link
Contributor

strepanier03 commented May 8, 2023

Bumped again as we're still unclear what the expected and preferred behavior will be.

@melvin-bot melvin-bot bot removed the Overdue label May 8, 2023
@strepanier03
Copy link
Contributor

After a few different discussions, we have come to a consensus that we don't want emoji to be allowed as anchor text for hyperlinks.

@strepanier03 strepanier03 added the External Added to denote the issue can be worked on by a contributor label May 10, 2023
@melvin-bot melvin-bot bot changed the title Emoji-only Anchor Text with Hyperlink is accepted/doesn't look right [$1000] Emoji-only Anchor Text with Hyperlink is accepted/doesn't look right May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016f4e82bec390b3ae

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

Triggered auto assignment to @marcochavezf (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@nazmulpcc
Copy link

Proposal

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

Emoji only hyperlink doesn't look good.

What is the root cause of that problem?

The link doesn't look good because of the added underline below the emojis.

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

As mentioned here we do no want emojis as anchor text in hyperlinks. We can mark the field as "invalid" when some/all anchor text is an emoji and let the user edit the anchortext. We can achieve this by following how ExceededCommentLength is used in ReportActionCompose

What alternative solutions did you explore? (Optional)

We can also

  • Remove the underline from links. Like github does:

  • Remove all emojies from anchortexts automatically. This can be achieved by removing all emojis when the text is parsed. This looks like a good place to process the anchor text with a regex and remove all emojis. In this case we also need to decide what the replacement anchortext should be.

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

📣 @nazmulpcc! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@sobitneupane
Copy link
Contributor

@nazmulpcc Thanks for your proposal.

Can you please be more descriptive in your proposal.

"What is the root cause of that problem?" section should include why is this issue occurring? Where in the codebase the problem lies? Please make use of permalinks.

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

We can achieve this by following how ExceededCommentLength is used in ReportActionCompose

Can you please explain how and for what purpose ExceededCommentLength is used in ReportActionCompose? What changes will be required in code base to solve this particular issue? Where will we make those changes?

@dukenv0307
Copy link
Contributor

dukenv0307 commented May 10, 2023

Proposal

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

Emoji only is accepted as an anchor text and it doesn't look pleasing to the eye.

As mentioned in #18386 (comment), we don't want emoji-only text to be anchor text for links.

What is the root cause of that problem?

We're not validating if the anchor text contains only emojis in the 'link' rule here https://github.com/Expensify/expensify-common/blob/b29d8528cd9be19a131ef77f9edfeb652d2af646/lib/ExpensiMark.js#L107.

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

If we don't want the anchor text to contain any emoji
We need to check if the anchor text g1 here contains any emoji:

if (g1.match(EMOJI_REGEX)) {
    return match;
}

(the EMOJI_REGEX can be taken from App here

App/src/CONST.js

Line 1005 in 32662bf

EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,
)

If we don't want the anchor text to contain only emojis

We need to check if the anchor text g1 here contains only emojis, we can make use of the existing logic in the containsOnlyEmojis method here

function containsOnlyEmojis(message) {
, if yes then we return match;.

After either of the change above (depending on what we want), it will show the user input as is without converting to <a> tag.

(We shouldn't make the composer look like it's invalid/show error message, we simply shouldn't match it as links)

IMO we should only does not allow anchor text to "contains only emojis", if it contains both text and emojis then it should be allowed since the underlined text in that case does not look that bad. Whatever the decision is the above will work fine.

What alternative solutions did you explore? (Optional)

NA

@sobitneupane
Copy link
Contributor

I'm assuming here that we only does not allow anchor text to "contains only emojis", if it contains both text and emojis then it should be allowed since the underlined text in that case does not look that bad.

@strepanier03 Can you please confirm wether we will allow anchor text to contain text with emojis or not?

@strepanier03
Copy link
Contributor

@sobitneupane - We do not want to allow emoji to be used as anchor text for hyperlinks moving forward.

@sobitneupane
Copy link
Contributor

sobitneupane commented May 11, 2023

Thanks @strepanier03. So, We will not be allowing emoji at all in the anchor text. Even text mixed with emoji like Mixed 🤒 Text 🤒 will not be allowed.

@dukenv0307 Would you like to update your proposal?

@dukenv0307
Copy link
Contributor

@sobitneupane sure thing!

Proposal updated

@sobitneupane
Copy link
Contributor

Thanks for the update @dukenv0307

Proposal from @dukenv0307 looks good to me.

cc: @marcochavezf

Result will look something like this
Screenshot 2023-05-12 at 20 11 53

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@dukenv0307
Copy link
Contributor

@sobitneupane the PR is ready for review

@melvin-bot
Copy link

melvin-bot bot commented May 16, 2023

🎯 ⚡️ Woah @sobitneupane / @dukenv0307, great job pushing this forwards! ⚡️

The pull request got merged within 2 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @dukenv0307 got assigned: 2023-05-16 00:33:10 Z
  • when the PR got merged: 2023-05-16 17:13:47 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 18, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Emoji-only Anchor Text with Hyperlink is accepted/doesn't look right [HOLD for payment 2023-05-25] [$1000] Emoji-only Anchor Text with Hyperlink is accepted/doesn't look right May 18, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.15-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-05-25. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter - @Nathan-Mulugeta - $250
  • Contributor that fixed the issue - @dukenv0307 - $1000 + $500 (speed bonus) = $1500
  • Contributor+ that helped on the issue and/or PR - @sobitneupane - $1000 + $500 (speed bonus) = $1500

Speed bonus assessment: here = Eligible

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:
  • [@sobitneupane] 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:
  • [@sobitneupane] 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:
  • [@sobitneupane] Determine if we should create a regression test for this bug.
  • [@sobitneupane] 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.
  • [@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/287309

@strepanier03
Copy link
Contributor

Prepping for the pay hold being removed


  • @sobitneupane - I've hired you to the UpWork job. Finish off the checklist whenever you can and I can update or make the reg test GH if applicable.

  • @dukenv0307 - I am having trouble locating your profile in Upwork, can you please apply for the job using this link and also let me know your first/last name in Upwork so I'm confident I'm hiring the right person?

  • @Nathan-Mulugeta - I've created a bug reporting job in Upwork and hired you as well.


Chat again on the 25th!

@dukenv0307
Copy link
Contributor

@strepanier03 I've applied! My profile is https://www.upwork.com/freelancers/~01f5cbe690701118a2, thanks!

@strepanier03
Copy link
Contributor

Thank you so much @dukenv0307, I really appreciate it. I've hired you as well so we'll be ready for tomorrow.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels May 24, 2023
@strepanier03
Copy link
Contributor

@Nathan-Mulugeta and @dukenv0307 - I've paid you both via Upwork and ended the contracts, thank you!


@sobitneupane - I'll keep an eye out for the checklist responses and update them when I see you send them through. Then I'll finish pay out and close this GH.

@Nathan-Mulugeta
Copy link

Thanks @strepanier03 I just received.

@sobitneupane
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:

It's an improvement in the app. I don't think we can blame the PR allowing the emoji in url for causing this issue because it was lately decided to not allow emoji in the url.

@sobitneupane
Copy link
Contributor

sobitneupane commented May 27, 2023

Regression Test Proposal

  • Send a url having emoji as anchor-text ( i.e, Put an emoji inside of square brackets '[]' and put a link inside of parenthesis '()')
  • Verify that emoji is not considered as valid anchor-text.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label May 29, 2023
@strepanier03
Copy link
Contributor

Sounds good to me @sobitneupane - I can make that reg test GH.

@melvin-bot melvin-bot bot removed the Overdue label May 30, 2023
@strepanier03 strepanier03 changed the title [HOLD for payment 2023-05-25] [$1000] Emoji-only Anchor Text with Hyperlink is accepted/doesn't look right [PAID] [$1000] Emoji-only Anchor Text with Hyperlink is accepted/doesn't look right May 30, 2023
@strepanier03
Copy link
Contributor

Finished up everything here, paid out the remaining contract and closed it.

Thank you everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants