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

[HOLD for payment 2023-06-13] [$1000] Insert emoji before a colon text after is replaced by "1" string #19289

Closed
6 tasks done
kavimuru opened this issue May 19, 2023 · 32 comments
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 19, 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 any chat
  2. Type :em
  3. Move cursor before colon
  4. Type :em and select any emoji

Expected Result:

The text after emoji is replace by a space

Actual Result:

The text after emoji is replace by "1" string

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.16-5
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
Screencast from 17-05-2023 12_25_02.webm

Recording.654.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684301189498089

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f4ab1937aacf2d66
  • Upwork Job ID: 1664302246693322752
  • Last Price Increase: 2023-06-01
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 19, 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

@kavimuru
Copy link
Author

Proposal by @dukenv0307

Proposal

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

Insert emoji before a colon text after is replaced by "1" string

What is the root cause of that problem?

commentAfterColonWithEmojiNameRemoved is replaced by CONST.SPACE if the text after the cursor starting with a colon and ending with a space or newline character.

const commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end).replace(CONST.REGEX.EMOJI_REPLACER, CONST.SPACE);

But actually CONST.SPACE is "1" instead of space.

App/src/CONST.js

Line 1255 in 811c0f3

SPACE: 1,

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

We shoud change SPACE constant in here to space.

App/src/CONST.js

Line 1255 in 811c0f3

SPACE: 1,

What alternative solutions did you explore? (Optional)

We could remove replace function to remain the text after selection to same as Slack now.

@hungvu193
Copy link
Contributor

hungvu193 commented May 21, 2023

Proposal

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

Insert emoji before a colon text after is replaced by "1" string

What is the root cause of that problem?

We're using logic in here to calculate the logic when inserting an emoji:

const commentBeforeColon = this.state.value.slice(0, this.state.colonIndex);
const emojiObject = this.state.suggestedEmojis[highlightedEmojiIndex];
const emojiCode = emojiObject.types && emojiObject.types[this.props.preferredSkinTone] ? emojiObject.types[this.props.preferredSkinTone] : emojiObject.code;
const commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end).replace(CONST.REGEX.EMOJI_REPLACER, CONST.SPACE);

At line 594, we're using EMOJI_REPLACERregex to remove all the matched words with CONST.SPACE which equal 1.

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

Here's the evidence how slack handle the emoji in this case:

Screen.Recording.2023-05-21.at.23.28.24.mov

As we can see, slack doesn't remove the text after the selected emoji, and I think we can also do it in our case, instead of remove entire string, we should only remove unnecessary character after the selected emoji, in this case, that will be the semi colon, so we need to update the condition of commentAfterColonWithEmojiNameRemoved:

       let commentAfterColonWithEmojiNameRemoved;
        if (this.state.value.slice(this.state.selection.end).match(CONST.REGEX.EMOJI_REPLACER)) {
          // we can remove the semi colon right after the selection end, in case it matched our regex
            commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end + 1);
        } else {
            commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end)
        };

What alternative solutions did you explore? (Optional)

Do it like slack, we can also keep the semi colon:

commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end)

Result:

Screen.Recording.2023-05-21.at.23.36.40.mov

@melvin-bot melvin-bot bot added the Overdue label May 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

@muttmuure Whoops! This issue is 2 days overdue. Let's get this updated quick!

@muttmuure
Copy link
Contributor

Out of office this week, picking it up when I'm back.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

@muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@dukenv0307
Copy link
Contributor

dukenv0307 commented May 27, 2023

I can't update the above proposal so I create a new comment to make clear my alternative solution

What alternative solutions did you explore? (Optional)
We could remove replace function to remain the text after selection to same as Slack now.

This is the current behavior
Expensify:

Screen.Recording.2023-05-27.at.22.42.36.mov

Slack:

Screen.Recording.2023-05-27.at.22.43.27.mov

The difference is when inserting an emoji before semicolon, Slack will remain semicolon with the text after that

If we come up with this approach, We need to remove replace function here

const commentAfterColonWithEmojiNameRemoved = this.state.value.slice(this.state.selection.end).replace(CONST.REGEX.EMOJI_REPLACER, CONST.SPACE);

@melvin-bot
Copy link

melvin-bot bot commented May 30, 2023

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

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Jun 1, 2023
@melvin-bot melvin-bot bot changed the title Insert emoji before a colon text after is replaced by "1" string [$1000] Insert emoji before a colon text after is replaced by "1" string Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

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

@muttmuure
Copy link
Contributor

Reproduced

@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

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

@melvin-bot melvin-bot bot removed the Overdue label Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

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

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

melvin-bot bot commented Jun 1, 2023

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

@s77rt s77rt mentioned this issue Jun 1, 2023
54 tasks
@s77rt
Copy link
Contributor

s77rt commented Jun 1, 2023

@dukenv0307 Thanks for the proposal. Your RCA is correct. The alternative solution looks good to me i.e not to replace the text after the colon. It seems to work fine but not sure if it may break something else so I asked here #14686 (comment). In case this didn't work we will go with the first solution.

🎀 👀 🎀 C+ reviewed

cc @chiragsalian

@s77rt
Copy link
Contributor

s77rt commented Jun 1, 2023

@hungvu193 Thanks for the proposal but I think it's the same as @dukenv0307's proposal.

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

@chiragsalian @s77rt @muttmuure this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

📣 @dukenv0307 You have been assigned to this job by @chiragsalian!
Please apply to this job in Upwork 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 melvin-bot bot added the Reviewing Has a PR in review label Jun 5, 2023
@dukenv0307
Copy link
Contributor

@s77rt The PR is ready for review. But we still need to wait #14686 (comment) is resolved

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 6, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Insert emoji before a colon text after is replaced by "1" string [HOLD for payment 2023-06-13] [$1000] Insert emoji before a colon text after is replaced by "1" string Jun 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.24-5 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-06-13. 🎊

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
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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 Jun 6, 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:

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

@s77rt
Copy link
Contributor

s77rt commented Jun 6, 2023

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jun 13, 2023
@muttmuure
Copy link
Contributor

I've invited @s77rt to apply but my message had some old text in it about bug reporting by mistake. Sorry for the confusion!

@melvin-bot melvin-bot bot removed the Overdue label Jun 15, 2023
@s77rt
Copy link
Contributor

s77rt commented Jun 15, 2023

@muttmuure No problem! I have accepted the offer. By the way @dukenv0307 should also be invited for both contributor role and bug reporter

@muttmuure
Copy link
Contributor

@dukenv0307 not sure what name you go by in Upwork, please could you apply for the job? https://www.upwork.com/ab/applicants/1664302246693322752/job-details

@muttmuure
Copy link
Contributor

@s77rt paid

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 16, 2023

@muttmuure I've applied, my Upwork profile: https://www.upwork.com/freelancers/~01f5cbe690701118a2. Thanks.

@melvin-bot melvin-bot bot added the Overdue label Jun 19, 2023
@muttmuure
Copy link
Contributor

image

We have a support ticket open with Upwork

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2023
@muttmuure
Copy link
Contributor

@dukenv0307 invited

@melvin-bot melvin-bot bot added the Overdue label Jun 23, 2023
@muttmuure
Copy link
Contributor

Everyone has been paid

@dukenv0307 - $1750 for reporting and 3 day merge
@s77rt - $1500 for 3 day merge

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
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

6 participants