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

[$1000] Web - App does not change Spanish emoji text to emoji on change of language #23305

Closed
1 of 6 tasks
kbecciv opened this issue Jul 20, 2023 · 27 comments
Closed
1 of 6 tasks
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

@kbecciv
Copy link

kbecciv commented Jul 20, 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
  2. Ensure that language currently is English
  3. Open any report
  4. Type :helado: (Spanish for ice cream) or any other Spanish emoji text
  5. Change the language to Spanish and observe that message in compose box does not change to emoji
  6. Change report and revisit to see that now it is changed to ice cream emoji

Expected Result:

App should change Spanish emoji text to emoji when we change the language to Spanish

Actual Result:

App does not change Spanish emoji text to emoji when we change the language to Spanish and needs revisit to change

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:
Reproducible in staging?:
Reproducible in production?:
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

text.not.changed.to.emoji.on.language.change.mp4
Recording.3791.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c549a3221d600158
  • Upwork Job ID: 1683650330760372224
  • 2023-07-25
  • Automatic offers:
    • ahmedGaber93 | Contributor | 25797008
    • dhanashree-sawant | Reporter | 25797010
@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Jul 20, 2023

Proposal

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

App does not change spanish emoji text to emoji on change of language

What is the root cause of that problem?

The message value not update if language change because the condition above updateComment will break the code

if (this.props.report.reportID === prevProps.report.reportID && !shouldSyncComment) {
return;
}
this.updateComment(this.props.comment);

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

Update the message value when language change

 if (this.props.preferredLocale === prevProps.preferredLocale && this.props.report.reportID === prevProps.report.reportID && !shouldSyncComment) { 
     return; 
 } 
  
 this.updateComment(this.props.comment); 

What alternative solutions did you explore? (Optional)

we can use another check to check if the comment change after local change or not

const {text: newComment = ''} = EmojiUtils.replaceEmojis(this.state.value, this.props.preferredSkinTone, this.props.preferredLocale);


// const shouldSyncComment = prevProps.comment !== this.props.comment && this.state.value !== this.props.comment;
const shouldSyncComment = (prevProps.comment !== this.props.comment && this.state.value !== this.props.comment) || newComment !== this.state.value;

@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 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 Overdue label Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

@sophiepintoraetz
Copy link
Contributor

Yup!
2023-07-25_13-27-10 (1)

@melvin-bot melvin-bot bot removed the Overdue label Jul 25, 2023
@sophiepintoraetz sophiepintoraetz added External Added to denote the issue can be worked on by a contributor Overdue labels Jul 25, 2023
@melvin-bot melvin-bot bot changed the title Web - App does not change Spanish emoji text to emoji on change of language [$1000] Web - App does not change Spanish emoji text to emoji on change of language Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

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

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@sophiepintoraetz
Copy link
Contributor

Not overdue - waiting on proposals

@melvin-bot melvin-bot bot removed the Overdue label Jul 25, 2023
@lorentzimys
Copy link

lorentzimys commented Jul 25, 2023

Proposal

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

App does not change spanish emoji text to emoji on change of language

What is the root cause of that problem?

The comment is not updated because 'shouldSyncComment' does not take into account locale change.

// Value state does not have the same value as comment props when the comment gets changed from another tab.
// In this case, we should synchronize the value between tabs.
const shouldSyncComment = prevProps.comment !== this.props.comment && this.state.value !== this.props.comment;
// As the report IDs change, make sure to update the composer comment as we need to make sure
// we do not show incorrect data in there (ie. draft of message from other report).
if (this.props.report.reportID === prevProps.report.reportID && !shouldSyncComment) {
return;
}
this.updateComment(this.props.comment);

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

ahmedGaber93 logic was almost correct except the condition of 'shouldSyncComment' should be slightly different. I suggest it to be this way:

  const localeChanged = prevProps.preferredLocale !== this.props.preferredLocale;
  const shouldSyncComment = localeChanged || (prevProps.comment !== this.props.comment && this.state.value !== this.props.comment);

  // As the report IDs change, make sure to update the composer comment as we need to make sure
  // we do not show incorrect data in there (ie. draft of message from other report).
  if (this.props.report.reportID === prevProps.report.reportID && !shouldSyncComment) {
      return;
  }

  this.updateComment(this.props.comment); 

What alternative solutions did you explore? (Optional)

none

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

📣 @lorentzimys! 📣
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>

@lorentzimys
Copy link

lorentzimys commented Jul 25, 2023

Contributor details
Your Expensify account email: lorentzimys1@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~019f8212604bc5ba98

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@ahmedGaber93
Copy link
Contributor

const shouldSyncComment = localeChanged || (prevProps.comment !== this.props.comment && this.state.value !== this.props.comment);

@lorentzimys I think shouldSyncComment based on localeChanged will return incorrect value if there is no emoji like :helado: need to update.

My alternative solution #23305 (comment) work in this point and shouldSyncComment will return true if locale is changed and there is emoji like :helado: need to update.

Thanks!

@ArekChr
Copy link
Contributor

ArekChr commented Jul 25, 2023

The proposal from @ahmedGaber93 looks good to me.
🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

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

melvin-bot bot commented Jul 27, 2023

📣 @ahmedGaber93 🎉 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 Jul 27, 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

@bondydaa
Copy link
Contributor

assigned, leave me alone melvin

@melvin-bot melvin-bot bot removed the Overdue label Jul 27, 2023
@sophiepintoraetz
Copy link
Contributor

@ahmedGaber93 - are you ready to get started on the PR?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 28, 2023
@ahmedGaber93
Copy link
Contributor

@sophiepintoraetz @ArekChr PR is now ready for review.

@sophiepintoraetz
Copy link
Contributor

Waiting on a review from @bondydaa

@bondydaa
Copy link
Contributor

bondydaa commented Aug 2, 2023

I was actually talking to @stitesExpensify about this yesterday IRL and he mentioned we might have done this on purpose, going to double check if he had a second to review this or not.

@bondydaa
Copy link
Contributor

bondydaa commented Aug 3, 2023

ok chatted with stites and he thought it was a little different case at first so 👍 full steam ahead. will review the pr now.

@melvin-bot
Copy link

melvin-bot bot commented Aug 3, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @ahmedGaber93 got assigned: 2023-07-27 22:18:48 Z
  • when the PR got merged: 2023-08-03 15:06:57 UTC
  • days elapsed: 4

On to the next one 🚀

@ahmedGaber93
Copy link
Contributor

@sophiepintoraetz, any updates about payment here? This issue has been merged in production since 13 days ago

@sophiepintoraetz
Copy link
Contributor

Apologies @ahmedGaber93 - usually there's another checklist that comes through about initiating payments/BZ regression testing but we're all set here.

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

6 participants