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

[$500] Profile - The timezone does not exist after toggle off Automatically determine your location #28329

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 27, 2023 · 12 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 27, 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:

Precondition:

  1. Go to settings => profile => timezone
  2. Change "Automatically determine your location" from on to off.
  3. Select Timezone manual from dropdown list

Expected Result:

The timezone will show and auto select from "Automatically determine your location"

Actual Result:

No timezone selection

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: v 1.3.74-0

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

002.mp4
RPReplay_Final1695832227.MP4
RPReplay_Final1695690200.MP4
RPReplay_Final1695747320.MP4

Expensify/Expensify Issue URL:

Issue reported by: @suneox

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695577882053919

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015ad1c1482cffdc01
  • Upwork Job ID: 1707072714927910912
  • Last Price Increase: 2023-09-27
@izarutskaya izarutskaya 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 27, 2023
@melvin-bot melvin-bot bot changed the title Profile - The timezone does not exist after toggle off Automatically determine your location [$500] Profile - The timezone does not exist after toggle off Automatically determine your location Sep 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015ad1c1482cffdc01

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

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

melvin-bot bot commented Sep 27, 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
Copy link

melvin-bot bot commented Sep 27, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Sep 27, 2023

Proposal

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

Profile - The timezone does not exist after toggle off Automatically determine your location

What is the root cause of that problem?

We are missing some timezones in TIMEZONES.js that make initiallyFocusedOptionKey is undefined and no option is focused

initiallyFocusedOptionKey={_.get(_.filter(timezoneOptions, (tz) => tz.text === timezone.selected)[0], 'keyForList')}

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

We should add those timezones that are missed in TIMEZONES.js

What alternative solutions did you explore? (Optional)

I think to BE should return the correct name of the timezone, example Asia/Saigon now is Asia/Ho_Chi_Minh, America/Cordoba now is America/Argentina/Cordoba.

@suneox
Copy link
Contributor

suneox commented Sep 27, 2023

@izarutskaya You have missed my proposal ^^

@aimane-chnaif
Copy link
Contributor

@suneox's Proposal

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

The timezone does not exist after toggle off Automatically determine your location

What is the root cause of that problem?

The list of timezone is missing from

// All timezones were taken from: https://raw.githubusercontent.com/leon-do/Timezones/main/timezone.json

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

We should get data from a timezone database and I have parse List of tz database time zones upload file bellow we can replace for TIMEZONES.js

What alternative solutions did you explore? (Optional)

Create an automation script to update timezone list from Tz_database

  fetch(“https://en.wikipedia.org/wiki/List_of_tz_database_time_zones”).then(r => r.text()).then(html => {
    const $=cheerio.load(html);
    const timezones = $(.wikitable.sortable:first tbody tr td:nth-child(2)).map((k,v) => $(v).text()).toArray();
    // save to TIMEZONES.js
  })

@suneox
Copy link
Contributor

suneox commented Sep 27, 2023

The proposal from my comment in slack is missed attachment file so I would like to correct and update my alternative proposal bellow

Proposal

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

The timezone does not exist after toggle off Automatically determine your location

What is the root cause of that problem?

The list of timezone is missing from

// All timezones were taken from: https://raw.githubusercontent.com/leon-do/Timezones/main/timezone.json

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

We should get data from a timezone database and I have parse List of tz database time zones upload file bellow we can replace for TIMEZONES.js

What alternative solutions did you explore? (Optional)

The timezone will call API ?command=UpdateAutomaticTimezone at

function updateAutomaticTimezone(timezone) {

We can create a mapping config for timezone before submit to BE follow the tz_database backward link
Screenshot 2023-09-28 at 01 04 48

const timezoneBackwardMap = {
    'Africa/Accra': 'Africa/Abidjan',
    'Africa/Addis_Ababa': 'Africa/Nairobi',
    .....
};

and update

timezone: JSON.stringify(timezone),

to

    {
        timezone: JSON.stringify({automatic: timezone.automatic, selected: timezoneBackwardMap[timezone.selected] || timezone.selected}),
    }

@suneox
Copy link
Contributor

suneox commented Sep 27, 2023

I recommended using the primary solution from my proposal we only updated the missing timezone and BE still store a user tz correctly

@joekaufmanexpensify
Copy link
Contributor

I don't understand what the bug is here. This is working for me, and my sense is it is in the video as well. Discussing here.

@suneox
Copy link
Contributor

suneox commented Sep 28, 2023

@joekaufmanexpensify I have explained in this comment, and you have to change your device time to another country I provide in precondition step

@joekaufmanexpensify
Copy link
Contributor

Closing this based on this discussion. I can't reproduce the bug, and we don't want to proceed if it is not consistently reproducible.

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 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants