Skip to content

[Awaiting Miro Payment] [$1000] Timezone select page does not navigate back to timezone initial page after user changes timezone to automatic from another device #24516

Description

@m-natarajan

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. Login the same account on 2 devices
  2. From device A, go to the timezone details page and turn off automatic timezone selection
  3. From device B, go to the timezone select page.
  4. From device A, turn on automatic timezone selection.
  5. Notice in device B, user remains on the timezone select page, and if they come back to timezone details page, they cant go back to the select page because their timezone is automatic

Expected Result:

User should be redirected back to timezone details page if they update their timezone to automatic

Actual Result:

User is not redirected back to timezone details page if they update their timezone to automatic

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.53-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
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

Screen.Recording.2023-08-06.at.5.07.37.AM.mp4
Recording.2393.mp4

Expensify/Expensify Issue URL:
Issue reported by: @huzaifa-99
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691280927472319

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b0a8cd3364d19ad6
  • Upwork Job ID: 1691038383142993920
  • Last Price Increase: 2023-08-14
  • Automatic offers:
    • bernhardoj | Contributor | 26131162
    • huzaifa-99 | Reporter | 26131163

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 13, 2023
  2. melvin-bot commented on Aug 13, 2023

    @melvin-bot

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

  3. melvin-bot commented on Aug 13, 2023

    @melvin-bot

    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
  4. m-natarajan commented on Aug 13, 2023

    @m-natarajan
    Author

    Proposal by @huzaifa-99

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

    We want the user to navigate back to the initial timezone page from the select page, if they change their timezone to automatic from another device.

    What is the root cause of that problem?

    We are not navigating the user back to initial timezone page when they change their timezone to automatic from another device.

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

    We are already listening to the props.currentUserPersonalDetails in TimezoneSelectPage so we just need to navigate back to timezone initial page from the timezone select page whenever

    1. User updates their timezone to automatic from another device
    2. User loads the timezone select page URL /settings/profile/timezone/select
      something like this pseudocode here and here
    if(timezone.automatic) {
        Navigation.goBack(ROUTES.SETTINGS_TIMEZONE);
        return
    }
    

    What alternative solutions did you explore? (Optional)

    N/A

  5. huzaifa-99 commented on Aug 13, 2023

    @huzaifa-99
    Contributor

    Proposal

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

    We want the user to navigate back to the initial timezone page from the select page, if they change their timezone to automatic from another device.

    What is the root cause of that problem?

    We are not navigating the user back to initial timezone page when they change their timezone to automatic from another device.

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

    We are already listening to the props.currentUserPersonalDetails in TimezoneSelectPage so we just need to navigate back to timezone initial page from the timezone select page whenever

    1. User updates their timezone to automatic from another device
    2. User loads the timezone select page URL /settings/profile/timezone/select

    something like this pseudocode here and here

    if(timezone.automatic) { 
        Navigation.goBack(ROUTES.SETTINGS_TIMEZONE);
        return
    }
    

    What alternative solutions did you explore? (Optional)

    N/A

  6. ahmedGaber93 commented on Aug 13, 2023

    @ahmedGaber93
    Contributor

    Proposal

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

    Timezone select page does not navigate back to timezone initial page after user changes timezone to automatic from another device

    What is the root cause of that problem?

    User can open select timezone page by link normally without any handling to hide this when the timezone is automatic.

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

    We need to wrap page content with FullPageNotFoundView

    <ScreenWrapper includeSafeAreaPaddingBottom={false}>
      <FullPageNotFoundView shouldShow={this.timezone.automatic}> 
         ...
      </FullPageNotFoundView>
    </ScreenWrapper>

    We can also display specific message in FullPageNotFoundView like you can't select timezone

    What alternative solutions did you explore? (Optional)

    N/A

  7. bernhardoj commented on Aug 14, 2023

    @bernhardoj
    Contributor

    Proposal

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

    User can access the timezone selection page and even select a new timezone even though the user has already turned on the automatic timezone.

    What is the root cause of that problem?

    This issue was previously fixed here #14340 where we decided to disable the list when the automatic timezone is turned on. However, this stops working after :

    1. The list is migrated from OptionsSelector to SelectionListRadio
      The timezone is disabled if the automatic timezone is on here:
      sections={[{data: timezoneOptions, indexOffset: 0, isDisabled: timezone.current.automatic}]}

    OptionsSelector uses OptionsList which renders OptionRow as its item and it will have a condition to disable the OptionRow. We can basically disable it by disabling the whole list (props.isDisabled), each section (section.isDisabled), or each item (item.isDisabled)

    renderItem({item, index, section}) {
    const isDisabled = this.props.isDisabled || section.isDisabled || !!item.isDisabled;
    return (
    <OptionRow
    option={item}
    showTitleTooltip={this.props.showTitleTooltip}
    hoverStyle={this.props.optionHoveredStyle}
    optionIsFocused={!this.props.disableFocusOptions && !isDisabled && this.props.focusedIndex === index + section.indexOffset}
    onSelectRow={this.props.onSelectRow}
    isSelected={Boolean(_.find(this.props.selectedOptions, (option) => option.accountID === item.accountID))}
    showSelectedState={this.props.canSelectMultipleOptions}
    boldStyle={this.props.boldStyle}
    isDisabled={isDisabled}

    However, the SelectionListRadio don't have a condition to disable its item (RadioListItem).

    const renderItem = ({item, index, section}) => {
    const isFocused = focusedIndex === index + lodashGet(section, 'indexOffset', 0);
    return (
    <RadioListItem
    item={item}
    isFocused={isFocused}
    onSelectRow={props.onSelectRow}
    />
    );
    };

    1. and the page is migrated to the function component.
      Notice that the timezone is a ref and it never updates when we change it (turn on/off the automatic timezone) from other devices/browser tabs.
      sections={[{data: timezoneOptions, indexOffset: 0, isDisabled: timezone.current.automatic}]}

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

    1. Disable the item if it's disabled
    const renderItem = ({item, index, section}) => {
        const isDisabled = section.isDisabled;
        const isFocused = !isDisabled && ...;
    
        return <RadioListItem isDisabled={isDisabled} .../>;
    };
    

    and disable the pressable of the item.

    function RadioListItem(props) {
    return (
    <PressableWithFeedback
    onPress={() => props.onSelectRow(props.item)}
    accessibilityLabel={props.item.text}

    I only use section.isDisabled for the disabled condition because only the timezone list that uses SelectionListRadio and the disabled state is on the section object.

    1. Don't use ref for the timezone object
      const timezone = useRef(getUserTimezone(props.currentUserPersonalDetails));

    just like what we did in the timezone initial page

    const timezone = lodashGet(props.currentUserPersonalDetails, 'timezone', CONST.DEFAULT_TIME_ZONE);

  8. trjExpensify commented on Aug 14, 2023

    @trjExpensify
    Contributor

    I don't think anyone is going to really run into the scenario in the OP in practice. That said, if I'm following it correctly and there's a regression insofar as being able to load the list of timezones from a URL and a fix here resolves that as well, let's go ahead.

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 14, 2023
  10. changed the title [-]Timezone select page does not navigate back to timezone initial page after user changes timezone to automatic from another device[/-] [+][$1000] Timezone select page does not navigate back to timezone initial page after user changes timezone to automatic from another device[/+] on Aug 14, 2023
  11. melvin-bot commented on Aug 14, 2023

    @melvin-bot
  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 14, 2023
  13. melvin-bot commented on Aug 14, 2023

    @melvin-bot

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

  14. 32 remaining items

  15. 0xmiroslav commented on Sep 18, 2023

    @0xmiroslav
    Contributor

    If you're waiting for price confirmation:
    1.5k (original price stated on GH title plus efficiency bonus applies based on #24516 (comment))

  16. trjExpensify commented on Sep 18, 2023

    @trjExpensify
    Contributor

    Thanks, super helpful! So confirming payments due as follows:

    • no regression deductions
    • #urgency bonus is due
    • bounty prices pre-date the price change

    $250 to @huzaifa-99 for the bug report
    $1,500 to @0xmiroslav for the C+ review & #urgency bonus
    $1,500 to @bernhardoj for the fix & #urgency bonus

    Offers sent!

  17. huzaifa-99 commented on Sep 18, 2023

    @huzaifa-99
    Contributor

    @trjExpensify I received a new offer for reporting, however, I already accepted an offer before. Please let me know if we should go with the new or old one.

  18. trjExpensify commented on Sep 19, 2023

    @trjExpensify
    Contributor

    @bernhardoj - paid!
    @huzaifa-99 - paid!
    @0xmiroslav - waiting on you now.

  19. changed the title [-][$1000] Timezone select page does not navigate back to timezone initial page after user changes timezone to automatic from another device[/-] [+][Awaiting Miro Payment] [$1000] Timezone select page does not navigate back to timezone initial page after user changes timezone to automatic from another device[/+] on Sep 19, 2023
  20. melvin-bot commented on Sep 26, 2023

    @melvin-bot

    @trjExpensify, @mountiny, @bernhardoj, @0xmiroslav Eep! 4 days overdue now. Issues have feelings too...

  21. 0xmiroslav commented on Sep 26, 2023

    @0xmiroslav
    Contributor

    Not overdue

  22. trjExpensify commented on Sep 28, 2023

    @trjExpensify
    Contributor

    @0xmiroslav like the other issue, if you're tracking this somewhere else. I'm going to close it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions