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

[WAITING ON CHECKLIST][$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change #28265

Closed
4 of 6 tasks
kbecciv opened this issue Sep 26, 2023 · 62 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 Sep 26, 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 the app and ensure language is English
  2. Open any report
  3. Write any Spanish emoji text eg: Hello :rosa: (rosa is for rose emoji)
  4. Change language to Spanish
  5. Revisit the same report as step 2, focus on composer and observe that even after focus, emoji text is not changed to emoji
  6. Add any text or space, now it will be changed

Expected Result:

App should change the Spanish emoji text to emoji when language changed to Spanish and composer is focused

Actual Result:

App does not change the Spanish emoji text to emoji even when language changed to Spanish and composer is focused

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

spanish.text.to.emoji.not.working.IOS.native.safari.1.mov
spanish.emoji.text.not.converted.to.emoji.android.native.chrome.mp4
Screen_Recording_20230926_125040_Chrome.1.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695579134128109

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a987896441b75bec
  • Upwork Job ID: 1706679497712611328
  • Last Price Increase: 2023-10-17
  • Automatic offers:
    • situchan | Reviewer | 27351589
    • s-alves10 | Contributor | 27351590
    • dhanashree-sawant | Reporter | 27351593
@kbecciv kbecciv 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 26, 2023
@melvin-bot melvin-bot bot changed the title Chat - Spanish emoji text is not converted to emoji even on focus on language change [$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 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 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@ikevin127
Copy link
Contributor

ikevin127 commented Sep 26, 2023

Proposal

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

App should change the Spanish emoji text to emoji when language changed to Spanish and composer is focused.

What is the root cause of that problem?

The cause of the problem comes from the ComposerWithSuggestions.js component onFocus event which does not update the composer text like it's usually done via the updateComment function after the locales are changed.

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

Within the ComposerWithSuggestions.js component I created the focusUpdateComment function which updates the composer to render emojis on input focus then continues with the onFocus function passing the focus event to it:

     const focusUpdateComment = useCallback(e => {
        updateComment(commentRef.current, true);
        onFocus(e);
    }, [onFocus, updateComment]);

What alternative solutions did you explore? (Optional)

N/A

Videos

android.mp4
chrome.android.mp4
ios.mp4
safari.ios.mp4

@dummy-1111
Copy link
Contributor

dummy-1111 commented Sep 26, 2023

Proposal

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

Spanish emoji text is not converted to emoji even on focus after language is changed from English to Spanish
This issue happens on small-screen devices and for editing composer as well

What is the root cause of that problem?

On wide-screen devices, we have SilentCommentUpdater component here

This SilentCommentUpdater replaces emoji text to emoji when locale is changed

But this is not the case on small screen devices.
When language is changed, SilentCommentUpdater component isn't on the screen. When this component is mounted, the locale was changed already and the useEffect callback isn't called. In addition, in onFocus event handler, we don't have any code for doing this.

This is the root cause

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

We need to change the onFocus event handler

For the main composer, replace the below code

with

        onFocus={(e) => {
            updateComment(value);
            onFocus(e);
        }}

For the editing composer, insert the following code before this line

        updateDraft(draft);

This works as expected for both composers

Result
28265.mp4

What alternative solutions did you explore? (Optional)

It looks ugly updating the comment on focus
We can update on mount
Add the on-mount effect to the silent updater

    useEffect(() => {
        updateComment(comment);
    }, []);

Do the same for ReportActionItemMessageEdit

@kevdez
Copy link

kevdez commented Sep 26, 2023

Hello, this comment is for just trying to trigger the melvin-bot.

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

📣 @MintyAtmosphere! 📣
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. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. 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>

@kevdez
Copy link

kevdez commented Sep 26, 2023

Contributor details
Your Expensify account email: kernan373@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01bf0b962fb3225457

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@ghost
Copy link

ghost commented Sep 26, 2023

Proposal

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

Spanish emoji text is not changed to emoji even when language is changed to Spanish and composer is focused. The app should change the Spanish text emoji without changing language to Spanish or focusing on composer.

What is the root cause of that problem?

The TextInput component in React Native does not handle emojis properly, and may cut them off or delete them when maxlength is set.

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

We can use the library react-native-emoji-selector and the function convertToEmoji to trigger the conversion of Spanish emoji text to emoji.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Sep 29, 2023
@jliexpensify
Copy link
Contributor

Bump @situchan for reviews, cheers!

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@situchan
Copy link
Contributor

situchan commented Oct 3, 2023

No satisfactory proposals yet.

No one provided correct root cause.
As seen in this video, it works perfectly while chat page is open, both desktop and mobile.

Screen.Recording.2023-10-03.at.10.11.49.PM.mov

@dummy-1111
Copy link
Contributor

dummy-1111 commented Oct 3, 2023

@situchan

Did you have a look at my proposal?

But this is not the case on small screen devices.
When language is changed, SilentCommentUpdater component isn't on the screen. When this component is mounted, the locale was changed already and the useEffect callback isn't called. In addition, in onFocus event handler, we don't have any code for doing this.

This is the reason why the app works perfect while chat is opened. Please let me know if you think this isn't

@situchan
Copy link
Contributor

situchan commented Oct 3, 2023

@situchan

Did you have a look at my proposal?

But this is not the case on small screen devices.
When language is changed, SilentCommentUpdater component isn't on the screen. When this component is mounted, the locale was changed already and the useEffect callback isn't called. In addition, in onFocus event handler, we don't have any code for doing this.

This is the reason why the app works perfect while chat is opened. Please let me know if you think this isn't

But works fine to me even on small screen devices. Please check my video.

@dummy-1111
Copy link
Contributor

dummy-1111 commented Oct 3, 2023

@situchan

Even on small screen devices, if chat is opened when the language is changed. Your video is that case. Your another device's language is changed by pusher event(language is changed on other device)
In this issue, we change the language on the same device. So when we change the language, chat can't be opened.

@situchan
Copy link
Contributor

situchan commented Oct 3, 2023

What's the difference between changing language on same device and on another device?
Both get pusher event. The only difference is navigation/composer focused status.

@dummy-1111
Copy link
Contributor

dummy-1111 commented Oct 3, 2023

@situchan

Suppose that you change the language on Device A while chat is opened on Device B!
SilentCommentUpdater is in mounted state on Device B and this useEffect callback is called when it receives the pusher event notifying language change. This works correct

But suppose that we have only one device Device A
When we open settings -> preferences -> language, SilentCommentUpdater is unmounted and the useEffect callback isn't called. When we open the chat again, language was already changed and useEffect callback early returns because of this code. So the emoji can't be converted

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2023
@jliexpensify
Copy link
Contributor

Bump @situchan for review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Oct 30, 2023
@melvin-bot melvin-bot bot changed the title [$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change [HOLD for payment 2023-11-06] [$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

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

For reference, here are some details about the assignees on this issue:

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Nov 5, 2023
@jliexpensify
Copy link
Contributor

Bump @situchan to complete the checklist so I can issue payments!

@melvin-bot melvin-bot bot removed the Overdue label Nov 7, 2023
@jliexpensify
Copy link
Contributor

Payment Summary

Upwork job

@jliexpensify jliexpensify changed the title [HOLD for payment 2023-11-06] [$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change [WAITING ON CHECKLIST] [HOLD for payment 2023-11-06] [$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change Nov 7, 2023
@jliexpensify
Copy link
Contributor

Everyone is paid and job closed, @situchan please complete the checklist when you get online - thanks!

@jliexpensify jliexpensify removed the Awaiting Payment Auto-added when associated PR is deployed to production label Nov 8, 2023
@jliexpensify jliexpensify changed the title [WAITING ON CHECKLIST] [HOLD for payment 2023-11-06] [$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change [WAITING ON CHECKLIST][$500] Chat - Spanish emoji text is not converted to emoji even on focus on language change Nov 8, 2023
@situchan
Copy link
Contributor

situchan commented Nov 8, 2023

  • The PR that introduced the bug has been identified. Link to the PR: N/A
  • 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.
  • 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.

I don't propose regression test as it's edge case and minor inconsistency issue.

@situchan
Copy link
Contributor

situchan commented Nov 8, 2023

This is still eligible for bonus

@jliexpensify
Copy link
Contributor

@situchan can you point me to the GH comment from Melvin regarding the bonus?

I did post the summary here and no-one corrected me.

@situchan
Copy link
Contributor

situchan commented Nov 9, 2023

Maybe automation seemed broken.

Here's timeline:
Assign: #28265 (comment) (Oct 24)
Merge: #30301 (comment) (Oct 26)

@jliexpensify
Copy link
Contributor

Ok thanks, I'll need to create a new job and rehire you both.

@jliexpensify
Copy link
Contributor

Bonus payment: https://www.upwork.com/jobs/~016d6e54058c1f4ebc

Invited @s-alves10 and @situchan

@situchan
Copy link
Contributor

situchan commented Nov 9, 2023

@jliexpensify can you please use this contract?

Edit: Ah I see it's ended. Will accept new offer

@jliexpensify
Copy link
Contributor

No, it's closed
image

@dummy-1111
Copy link
Contributor

@jliexpensify

Offer accepted. Thanks

@jliexpensify
Copy link
Contributor

Paid both of you, closing job now!

@jliexpensify
Copy link
Contributor

@situchan @s-alves10 I just want to point out that you may not have been eligible for an urgency bonus for this job: we did recently cut this. That's why there may have not been a Melvin ping about it.

Anyway, the bonus has been paid but moving forward, I just wanted to point out this might be the reason why.

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

7 participants