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

[$500] Chat - App allows emoji link for email #28544

Closed
5 of 6 tasks
lanitochka17 opened this issue Sep 30, 2023 · 30 comments
Closed
5 of 6 tasks

[$500] Chat - App allows emoji link for email #28544

lanitochka17 opened this issue Sep 30, 2023 · 30 comments
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

@lanitochka17
Copy link

lanitochka17 commented Sep 30, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open any report
  3. Send any website URL as link with emoji as its text eg: 😂
  4. Observe that app keeps emoji and link separate
  5. Instead of website URL, use any email eg: 😂
  6. Observe that now app converts emoji into link with link as mailto of the email

Expected Result:

App should not convert emoji into link like it doesn't for normal website URL

Actual Result:

App converts emoji into link when we use email in link format

Workaround:

Unknown

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.75-3

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

windows.chrome.emoji.as.link.for.email.mp4
android.native.app.allows.emoji.link.for.email.mp4
android.chrome.emoji.email.link.mp4
ios.native.safari.mac.chrome.desktop.emoji.as.link.on.used.with.email.mov
Recording.113.mp4
android.native.app.allows.emoji.link.for.email.2.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695837410025229

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01738d1f93a454a1eb
  • Upwork Job ID: 1708186588535078912
  • Last Price Increase: 2023-09-30
  • Automatic offers:
    • hoangzinh | Reviewer | 27025452
    • c3024 | Contributor | 27025454
    • dhanashree-sawant | Reporter | 27025456
@c3024
Copy link
Contributor

c3024 commented Sep 30, 2023

Proposal

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

Email links with emojis work fine but website links do not

What is the root cause of that problem?

This is the parsing we are using
https://github.com/Expensify/expensify-common/blob/82c45d69668251b7abf22a2a17334f5e8823cebc/lib/ExpensiMark.js#L59-L85
This here
https://github.com/Expensify/expensify-common/blob/82c45d69668251b7abf22a2a17334f5e8823cebc/lib/ExpensiMark.js#L80
shows that for links if it matches with emoji the original match is returned which is the emoji followed by link.
In case of email there is no such comparsion so it is parsed differently.

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

If we like the parsing of link to be followed for email we need to change the email part to

            {
                name: 'email',
                process: (textToProcess, replacement) => {
                    const regex = new RegExp(
                        `(?!\[\s*\])\[([^[\]]*)]\(${CONST.REG_EXP.MARKDOWN_EMAIL}\)`, 'gim'
                    );
                    return this.modifyTextForEmailLinks(regex, textToProcess, replacement);
                },
                replacement: (match, g1, g2) => {
                    if (g1.match(CONST.REG_EXP.EMOJIS) || !g1.trim()) {
                        return match;
                    }
                    return `<a href="mailto:${g2}">${g1.trim()}</a>`
                },
            },

What alternative solutions did you explore? (Optional)

If we want the parsing of email to be followed for link we can omit the emoji comparison in link similar to the email.

@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 30, 2023
@melvin-bot melvin-bot bot changed the title Chat - App allows emoji link for email [$500] Chat - App allows emoji link for email Sep 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 30, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01738d1f93a454a1eb

@melvin-bot
Copy link

melvin-bot bot commented Sep 30, 2023

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

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

melvin-bot bot commented Sep 30, 2023

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

@hoangzinh
Copy link
Contributor

@c3024 Thanks for your proposal #28544 (comment). You pointed out a correct RCA and proposed a good solution. I tested it with various cases and it looks good

Screenshot 2023-10-02 at 14 12 40

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

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

melvin-bot bot commented Oct 4, 2023

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

melvin-bot bot commented Oct 4, 2023

📣 @c3024 🎉 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@tylerkaraszewski
Copy link
Contributor

Not overdue.

@c3024
Copy link
Contributor

c3024 commented Oct 5, 2023

Thank you for assigning this to me.
PR ready for review.
@hoangzinh

@melvin-bot melvin-bot bot added the Overdue label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

@tylerkaraszewski, @hoangzinh, @isabelastisser, @c3024 Eep! 4 days overdue now. Issues have feelings too...

@hoangzinh
Copy link
Contributor

@c3024 It seems we forgot to bump the library in Expensify/App.

@melvin-bot melvin-bot bot removed the Overdue label Oct 10, 2023
@c3024
Copy link
Contributor

c3024 commented Oct 10, 2023

How to do that?

@hoangzinh
Copy link
Contributor

@c3024 you can check this PR for an example #28985

@c3024
Copy link
Contributor

c3024 commented Oct 10, 2023

Oh! Now, I see that @eh2077 added their commit hash to the package.json. Their PR was merged after my PR was merged.
With their commit hash, my change was already included.
Do I still need to do anything?
@hoangzinh

@hoangzinh
Copy link
Contributor

@c3024 could you test again and confirm it works in latest main branch? Thanks

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 11, 2023
@c3024

This comment was marked as outdated.

@c3024
Copy link
Contributor

c3024 commented Oct 11, 2023

No PR is created here because hash of a later merged PR 585 of expensify-common was already added to package.json of Expensify/App with PR #28985 and that includes the changes made in 583 of expensify-common as well.

Videos for the PR 583 merged into expensify-common for this issue:

Screenshots/Videos

Android: Native
androidEmoji.mp4
Android: mWeb Chrome
emojimWeb.mp4
iOS: Native
iOSNative.mov
iOS: mWeb Safari
iOSSafariEmoji.mov
MacOS: Chrome / Safari
webEmoji.mov
MacOS: Desktop
desktopWeb.mov

cc: @hoangzinh @tylerkaraszewski

@hoangzinh
Copy link
Contributor

@isabelastisser @tylerkaraszewski

Context: Both #28344 and this GH issue need to do 2 steps:

Unfortunately, as @c3024 found out #28544 (comment), the PR #28985 also includes his commit fix so he doesn't need to do the step 2. It makes our automation process doesn't work (because there is no PR in Expensify/App). So could we manually make this GH issue hold for the same payment date with #28344? Thanks

@c3024
Copy link
Contributor

c3024 commented Oct 23, 2023

@tylerkaraszewski @isabelastisser

Please refer to this comment.

PR on expensify-common was merged within 3 days from assigning for this issue.

Screenshot 2023-10-23 at 10 47 43 AM Screenshot 2023-10-23 at 10 48 40 AM

Can this be considered for bonus?

@hoangzinh
Copy link
Contributor

Can this be considered for bonus?

I'm afraid that it couldn't. We were assigned on Oct 4, but until Oct 10, we started to do 2nd part of the progress (create/test in Expensify/App) #28544 (comment). And we came up with just testing on Oct 11.

@hoangzinh
Copy link
Contributor

@isabelastisser could you check my comment here #28544 (comment)?. The issue #28344 has been paid out and closed.

@hoangzinh
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: N/A, it's just an improvement to handle another sophisticated case in order to support markdown content.
  • 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
  • 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
  • Determine if we should create a regression test for this bug. ❌ I think we don't need it, we have added unit tests for such cases inside expensify-common repo

@hoangzinh
Copy link
Contributor

cc @isabelastisser on #28544 (comment)

@isabelastisser
Copy link
Contributor

isabelastisser commented Nov 10, 2023

Hey @hoangzinh, sorry for the delay! I see that we processed the payment for the other issue that you mentioned above. To clarify, do I need to process the same payment amount for this issue?

Please confirm if the payment summary looks correct:

@hoangzinh
Copy link
Contributor

Yes I think it's correct. cc @c3024

@hoangzinh
Copy link
Contributor

cc @isabelastisser on payment ^

@isabelastisser
Copy link
Contributor

The payments were made in Upwork. 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
None yet
Development

No branches or pull requests

5 participants