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

Timestring is not being properly set on Refreshing the tab when the Language is English #4404

Closed
aman-atg opened this issue Aug 4, 2021 · 16 comments
Assignees
Labels
Engineering Improvement Item broken or needs improvement. Monthly KSv2 Reviewing Has a PR in review

Comments

@aman-atg
Copy link
Contributor

aman-atg commented Aug 4, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Details

#4218 (comment)

Action Performed:

  1. Go to newDot
  2. Open any chat
  3. Refresh the page
  4. timestring will update from Spanish to English even when the Language is set to English

Expected Result:

It should show the timestring in the language that is set.

Actual Result:

bug.mp4

Workaround:

Visual Issue.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:

View all open jobs on Upwork

@aman-atg aman-atg added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Aug 4, 2021
@MelvinBot
Copy link

Triggered auto assignment to @lschurr (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Aug 4, 2021
@aman-atg
Copy link
Contributor Author

aman-atg commented Aug 4, 2021

Proposal

Explaination

  • This is a regression which is most likely caused by this 72800fc
  • Earlier we were getting preferredLocale inside props when we used withLocalize but after the above commit this.props.preferredLocale became undefined
  • And then locale was passed inside props for child comps. instead of preferredLocale after this 69fd992
  • This is causing the moment.locale to take undefined as an argument here which was defined earlier to these commits
    moment.locale(this.props.preferredLocale);

Solution

@aman-atg aman-atg changed the title Timestring is not being properly set for English on Refreshing the tab Timestring is not being properly set on Refreshing the tab when the Language is English Aug 4, 2021
@parasharrajat
Copy link
Member

@aman-atg would you mind commenting of the PR that caused the regression? It will help everyone.

Thanks for taking the time to find the issue and creating a ticket for it

@aman-atg
Copy link
Contributor Author

aman-atg commented Aug 4, 2021

@parasharrajat It's the same PR that caused #4352. The issue it solved is #4268.
The last PR also couldn't fix it.
I have mentioned commits here #4404 (comment) for a better understanding

@parasharrajat
Copy link
Member

parasharrajat commented Aug 4, 2021

Yeah, that's why to fix this regression another PR should be made by the original author. Don't you think so?

Could you please mention/tag the respective persons who found the original issue?

@arpitdeveloper
Copy link

In this case we update "locale: this.props.preferredLocale"
to "preferredLocale: this.props.preferredLocale"
in "App/src/components/withLocalize.js"

@aman-atg
Copy link
Contributor Author

aman-atg commented Aug 4, 2021

Yeah, that's why to fix this regression another PR should be made by the original author. Don't you think so?

There're many instances when regressions are fixed as Separate issues when found out later after the PR is merged.
But I don't think that I'm eligible to answer that question. Someone will surely clarify later.

Could you please mention/tag the respective persons who found the original issue?

I've already provided context in the ticket itself.

Details

#4218 (comment)

@lschurr
Copy link
Contributor

lschurr commented Aug 4, 2021

Is this a duplicate of this one then? #4218

@aman-atg
Copy link
Contributor Author

aman-atg commented Aug 4, 2021

No. In that issue we were not showing Spanish version at all.
And currently the English version is being updated with a delay in this Issue.

@parasharrajat
Copy link
Member

parasharrajat commented Aug 4, 2021

@lschurr I see that Changes here #4366 caused this issue.

As @aman-atg mentioned #4404 (comment).
That prop name was renamed in that PR to locale.

@lschurr lschurr added Engineering Improvement Item broken or needs improvement. Weekly KSv2 labels Aug 4, 2021
@MelvinBot
Copy link

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

@lschurr lschurr removed the Daily KSv2 label Aug 4, 2021
@lschurr
Copy link
Contributor

lschurr commented Aug 4, 2021

Tagging Eng for another set of eyes.

@lschurr lschurr removed their assignment Aug 4, 2021
@Luke9389
Copy link
Contributor

Luke9389 commented Aug 4, 2021

@parasharrajat is correct in saying this should be fixed by the original author. We always wait 7 days to pay our contributors so that we can find regressions like this one. The PR we've been linking to is actually another regression fix from this original one, which was only merged 5 days ago.

Thus I think @kidroca should make this change (it's a tiny one-liner change but that's our process).

@kidroca
Copy link
Contributor

kidroca commented Aug 5, 2021

@aman-atg
Thanks for the info, I'll submit another PR
I've missed that previously preferredLocale was along the ...props spread
I've only passed locale to trigger re-render when it changes, I had no idea it was actually used in the child components...

@aman-atg
Copy link
Contributor Author

aman-atg commented Aug 5, 2021

@kidroca
No problem mate!

@Luke9389 Luke9389 added the Reviewing Has a PR in review label Aug 9, 2021
@MelvinBot MelvinBot removed the Weekly KSv2 label Sep 2, 2021
@MelvinBot
Copy link

This issue has not been updated in over 15 days. @Luke9389 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@MelvinBot MelvinBot added the Monthly KSv2 label Sep 2, 2021
@Luke9389 Luke9389 closed this as completed Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Improvement Item broken or needs improvement. Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants