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

[PAID] [$1000] The months are not dynamically updated to Spanish language when language preference is changed from the other device #17098

Closed
1 of 6 tasks
kavimuru opened this issue Apr 6, 2023 · 39 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 Apr 6, 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 android and login with User A (should have english language preference at first)
  2. Go to Settings > Profile > Personal details. Click on the date of birth field.
  3. See that the months are in English and do not leave this page (don't press back or save)
  4. Now go to mweb chrome with the same User A and change the language to Spanish
  5. Go back to android and notice that the header 'Date of birth' and the placeholder 'AAAA-MM-DD' has been dynamically updated , but the months are still shown in English. Thus, in the same page , few components (header/placeholder) gets updated dynamically whereas the other few components (months) are not updated.

Expected Result:

The months should also be updated dynamically when language has been changed from the other device in a similar way how the header and the placeholder gets updated

Actual Result:

Months doesn't update dynamically when the language is changed from the other device whereas, for the same page, header and placeholder gets updated properly

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

update.mp4

Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680768933826169

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010b3f907903b77b6d
  • Upwork Job ID: 1648104574408331264
  • Last Price Increase: 2023-04-17
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 6, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 6, 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 Apr 10, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@tjferriss
Copy link
Contributor

I'm unable to reproduce using these steps.

Screenshot 2023-04-11 at 8 44 50 PM

@melvin-bot melvin-bot bot removed the Overdue label Apr 12, 2023
@tjferriss tjferriss added the Needs Reproduction Reproducible steps needed label Apr 12, 2023
@priya-zha
Copy link

priya-zha commented Apr 12, 2023

@tjferriss Can you try this with a real device. I tried it again and it's still reproducible.

demo

@melvin-bot melvin-bot bot added the Overdue label Apr 14, 2023
@MelvinBot
Copy link

@tjferriss Eep! 4 days overdue now. Issues have feelings too...

@tjferriss tjferriss assigned strepanier03 and unassigned tjferriss Apr 17, 2023
@melvin-bot melvin-bot bot removed the Overdue label Apr 17, 2023
@strepanier03
Copy link
Contributor

I have a Google Pixel 6 Pro on Android 13. I'll give this a shot.

@strepanier03
Copy link
Contributor

I am able to recreate this behavior.

Screenshot_20230417-161340
Screenshot_20230417-161346
Screenshot_20230417-161352

@strepanier03 strepanier03 added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Apr 17, 2023
@melvin-bot melvin-bot bot changed the title The months are not dynamically updated to Spanish language when language preference is changed from the other device [$1000] The months are not dynamically updated to Spanish language when language preference is changed from the other device Apr 17, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~010b3f907903b77b6d

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 17, 2023
@Prince-Mendiratta
Copy link
Contributor

Proposal

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

In this issue, when we are on the Date Picker page and we change the user locale from another device, the date picker itself does not re render with the updated language changes, leading to only partial locale change.

What is the root cause of that problem?

The root cause behind this issue is that instead of storing the month and weekday names in the react state, we have declared them as a property, which is not updated on locale change.
https://github.com/Expensify/App/blob/e56b9c76e8d2f058625c9dc729d700e12130c7f8/src/components/CalendarPicker/index.jsL22-L23

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

We store monthNames and daysOfWeek in the state. We add a new condition to the componentDidUpdate such that if there are changes to the preferred locale, we udpate the state with the new locale.

To facilitate these changes in a neat manner, we will create a function getYearAndMonthData:

getYearAndMonthData() {
    return {
        monthNames: _.map(moment.localeData(this.props.preferredLocale).months(), Str.recapitalize),
        daysOfWeek: _.map(moment.localeData(this.props.preferredLocale).weekdays(), day => day.toUpperCase()),
    };
}

Using this function, we will set the state in the constructor. In the componentDidUpdate condition as well, we will directly call this.setState(this.getYearAndMonthData());.

This will ensure that the items displayed in the date picker are updated as well once the locale is updated.

@MelvinBot
Copy link

Triggered auto assignment to @grgia (External), 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 Apr 20, 2023
@MelvinBot
Copy link

📣 @allroundexperts You have been assigned to this job by @grgia!
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 📖

@allroundexperts
Copy link
Contributor

PR created #17780

@strepanier03
Copy link
Contributor

I am going to be OoO from April 26-May 3. I plan to leave this GH assigned to me during my out-of-office as it likely won't need my action before I return.

If something changes and action is needed from the BugZero team, please reach out in #expensify-open-source to request help from another team member.

Thanks, chat with you when I get back!

@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 26, 2023
@melvin-bot melvin-bot bot changed the title [$1000] The months are not dynamically updated to Spanish language when language preference is changed from the other device [HOLD for payment 2023-05-03] [$1000] The months are not dynamically updated to Spanish language when language preference is changed from the other device Apr 26, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 26, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.5-6 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-05-03. 🎊

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 - @priya-zha - $250
  • Contributor that fixed the issue - @allroundexperts - $1000 + $500 (speed bonus) = $1500
  • Contributor+ that helped on the issue and/or PR - @thesahindia - $1000 + $500 (speed bonus) = $1500

Speed bonus analysis - PR submitted April 21 / PR merged April 24 = Eligible

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 26, 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:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels May 2, 2023
@strepanier03
Copy link
Contributor

I'm just back from out of office so catching up on this now.


@allroundexperts and @thesahindia - I have hired you both to the Upwork job and will check to pay today.

@thesahindia if you can work on the BZ checklist I can check off boxes or make the reg test GH as needed.


@priya-zha - I have also hired you toa bug reporting job in Upwork.

@strepanier03
Copy link
Contributor

I'll check in later today to pay anything I can.

@priya-zha
Copy link

Thanks. Accepted the offer.

@strepanier03
Copy link
Contributor

@priya-zha and @allroundexperts - I've paid you both via Upwork.

I'll check tomorrow for paying @thesahindia

@thesahindia
Copy link
Member

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:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:

#15343

  • [@thesahindia] 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:

https://github.com/Expensify/App/pull/15343/files#r1186457607

  • [@thesahindia] 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:

https://expensify.slack.com/archives/C049HHMV9SM/p1683317117553869

  • [@thesahindia] Determine if we should create a regression test for this bug.

Yes, I think we should.

  • [@thesahindia] 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.

Instead of adding a regression test case for this specific page we should test this behaviour on all the pages.

Regression test proposal

  1. Open new dot at two devices
  2. Go to any page that you wanna test on device 1
  3. At device 2 go to settings > preferences > Language
  4. Change the language
  5. Go to device 1 and verify the text got translated to the chosen language

@thesahindia
Copy link
Member

I'll check tomorrow for paying @thesahindia

Accepted, thanks!

@strepanier03
Copy link
Contributor

Thank you @thesahindia, I'll take the rest from here and pay you in Upwork as well.

@strepanier03 strepanier03 changed the title [HOLD for payment 2023-05-03] [$1000] The months are not dynamically updated to Spanish language when language preference is changed from the other device [PAID] [$1000] The months are not dynamically updated to Spanish language when language preference is changed from the other device May 5, 2023
@strepanier03
Copy link
Contributor

All set here. Checklist is done, reg test is ready, and everyone has been paid.


Thank you everyone for working on this and together with the team.

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

9 participants