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-04-12] [$1000] Web -If even the tone of the emoji is dark, the emoji that sent via emoji code is in light tone #15805

Closed
1 of 6 tasks
kbecciv opened this issue Mar 9, 2023 · 35 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Mar 9, 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. Go to URL https://staging.new.expensify.com/
  2. Login with any account
  3. Go to any chat
  4. Send and emoji via emoji code, for example :+1: 0 making sure you type out the full code (e.g. I type :facepalm: + Enter, it uses the default yellow emoji color). But if you type :face + Enter to auto-complete, it uses the correct skin tone from my profile.
  5. Pay attention to the tone of the emoji sent via the code and the tone of the account emoji

Expected Result:

The tone of the emoji sent via the code is identical to the account's emoji code

Actual Result:

The emojis I send via emoji code are always in light tone regardless of the emoji tone

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.2.81.0

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

Bug5970815_Recording__3870__1_.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017e0cd67725884fcc
  • Upwork Job ID: 1640688255744696320
  • Last Price Increase: 2023-03-28
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 9, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Mar 9, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Mar 9, 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

@sophiepintoraetz
Copy link
Contributor

@kbecciv - I'm not able to reproduce this on the Chrome (v1.2.81-1)?
2023-03-10_15-45-31 (1)

@melvin-bot melvin-bot bot added the Overdue label Mar 13, 2023
@sophiepintoraetz
Copy link
Contributor

Closing - waiting for confirmation.

@kavimuru
Copy link

kavimuru commented Mar 16, 2023

@sophiepintoraetz Adding from emoji picker works fine. After changing skin color, if you type :+1: it appears in default color. Is this expected behavior?

@Expensify Expensify unlocked this conversation Mar 21, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Mar 22, 2023

@sophiepintoraetz When we type the emoji code manually it is not considering the preferred skintone. Isn't it a bug?

@sakluger
Copy link
Contributor

@sophiepintoraetz I was able to reproduce this behavior. The issue occurs when you type out the emoji completely including the final :. So if I type :facepalm: + Enter, it uses the default yellow emoji color. But if I type :face + Enter to auto-complete, it uses the correct skin tone from my profile.

@sakluger sakluger reopened this Mar 25, 2023
@sophiepintoraetz
Copy link
Contributor

Okay, I was able to reproduce with the extra clarification from Sasha, so passing this over and updating the OP!

@MelvinBot
Copy link

Triggered auto assignment to @mountiny (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@mountiny
Copy link
Contributor

@perunt will take this on since they have implemented this feature originally

@perunt
Copy link
Contributor

perunt commented Mar 28, 2023

I didn't interact with that part of the code, but I know where the problem is. Also, I assume we have the same bug in editing the message. The fix is on the way 😄

@perunt perunt mentioned this issue Mar 28, 2023
53 tasks
@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Mar 28, 2023
@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Mar 28, 2023
@melvin-bot melvin-bot bot changed the title Web -If even the tone of the emoji is dark, the emoji that sent via emoji code is in light tone [$1000] Web -If even the tone of the emoji is dark, the emoji that sent via emoji code is in light tone Mar 28, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~017e0cd67725884fcc

@esh-g
Copy link
Contributor

esh-g commented Mar 28, 2023

Proposal

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

When replacing the code from the compose box with emoji, we don't consider the preferred skin tone of the user. So, the default skin tone gets inserted.
While the suggestions are relative to the preferred skin tone.

What is the root cause of that problem?

We don't check the preferredSkintone for the user while replacing emojis.

App/src/libs/EmojiUtils.js

Lines 195 to 205 in 68435f0

function replaceEmojis(text, isSmallScreenWidth = false) {
let newText = text;
const emojiData = text.match(CONST.REGEX.EMOJI_NAME);
if (!emojiData || emojiData.length === 0) {
return text;
}
for (let i = 0; i < emojiData.length; i++) {
const checkEmoji = emojisTrie.search(emojiData[i].slice(1, -1));
if (checkEmoji && checkEmoji.metaData.code) {
let emojiReplacement = checkEmoji.metaData.code;

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

The replaceEmojis function should have an additional parameter of preferredSkinTone and we can use that along with the getEmojiCodeWithSkinColor function from the same file.
When we are calling the replaceEmojis function, we just need to pass the preferredSkinTone of the user.
This function is used in ReportActionCompose.js and ReportActionItemMessageEdit.js

Like in the ReportActionCompose.js, We just need to pass the additional parameter as props.preferredSkinTone as the ONYX key for skin tone is already present in this file.

updateComment(comment, shouldDebounceSaveComment) {
const newComment = EmojiUtils.replaceEmojis(comment, this.props.isSmallScreenWidth);

But for ReportActionItemMessageEdit.js, we also need to add the ONYX key for preferred skin tone.

const newDraft = EmojiUtils.replaceEmojis(draft, this.props.isSmallScreenWidth);

After Applying

Screen.Recording.2023-03-25.at.1.13.29.AM.mov

@MelvinBot
Copy link

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

@mountiny mountiny removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 28, 2023
@mountiny
Copy link
Contributor

@esh-g Feel free to leave some suggestions/review the PR, seems like you noticed some crash there so if you can help us resolve this, I think its fair to compensate you too with $250 if that works

@esh-g
Copy link
Contributor

esh-g commented Mar 28, 2023

Thanks @mountiny, Will be sure to do so! 😇

@MelvinBot
Copy link

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@mountiny

This comment was marked as off-topic.

@s77rt
Copy link
Contributor

s77rt commented Apr 4, 2023

@mountiny It was not easy to catch, the issue only happens on production built js that's the reason tests pass. There is a diff between dev js files and built js files. We are looking to prevent such bugs (@Beamanator).

@mountiny
Copy link
Contributor

mountiny commented Apr 4, 2023

@s77rt thanks for the context, I guess in such case we wont treat it as regression.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Apr 5, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web -If even the tone of the emoji is dark, the emoji that sent via emoji code is in light tone [HOLD for payment 2023-04-12] [$1000] Web -If even the tone of the emoji is dark, the emoji that sent via emoji code is in light tone Apr 5, 2023
@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 5, 2023
@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.94-3 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-04-12. 🎊

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

@MelvinBot
Copy link

MelvinBot commented Apr 5, 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 / @mountiny] The PR that introduced the bug has been identified. Link to the PR:
  • [@s77rt / @mountiny] 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 / @mountiny] 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:
  • [@sophiepintoraetz] 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.
  • [@sophiepintoraetz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@s77rt
Copy link
Contributor

s77rt commented Apr 5, 2023

  • The PR that introduced the bug has been identified: None. Not a regression. This is a missing feature (from Render Emoji when typed with emoji code #10165)
  • The offending PR has been commented on: n/a
  • A discussion in #expensify-bugs has been started: I think this does not apply here (cc @mountiny)

Regression Test Proposal

  1. Open App
  2. Go to any chat
  3. Send :+1:
  4. Verify the sent emoji has the correct skin tone
  5. Change emojis's skin tone
  6. Send :+1:
  7. Verify the sent emoji has the correct updated skin tone

@mountiny
Copy link
Contributor

mountiny commented Apr 5, 2023

Thank you @s77rt agreed

@sophiepintoraetz lets add taht regression test thank you very much for help!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 11, 2023
@sophiepintoraetz
Copy link
Contributor

All right, payment date is coming up so as I understand it (@mountiny and @s77rt please confirm):

  • No reporting bonus as Applause reported this
  • $1000 to @perunt (PR submitted on 28 Mar and merged on 4 Apr - not eligible for bonus)
  • $1000 to @s77rt (PR submitted on 28 Mar and merged on 4 Apr- not eligible for bonus)

Regression test here

@mountiny
Copy link
Contributor

I think that sounds good to me, but @perunt is not being paid through Upwork

@sophiepintoraetz
Copy link
Contributor

@mountiny so how do we pay @perunt ?

@mountiny
Copy link
Contributor

mountiny commented Apr 13, 2023

@sophiepintoraetz Taras is from Margelo which is expert group which works with us, they invoice us for their work serparately, sorry for not clarifying this before

@sophiepintoraetz
Copy link
Contributor

Thank you - got it. Offer sent to @s77rt - I guess we'll leave it for Taras to invoice us accordingly through Margelo! Closing (reopen if I have this wrong).

@sophiepintoraetz sophiepintoraetz removed the Awaiting Payment Auto-added when associated PR is deployed to production label Apr 14, 2023
@s77rt
Copy link
Contributor

s77rt commented Apr 14, 2023

@sophiepintoraetz I think we usually close issues after payment and not during. But this should not take long anyway. I have accepted the offer. Thanks!

@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Apr 14, 2023

I think given that all actions are complete (i.e. offer is sent) and I get email notifications when you accept (and you can always follow up on the GH) - closing the issue slightly early doesn't matter @s77rt

In any case, contract is paid!

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. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants