Repository navigation
[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
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Aug 13, 2023 Triggered auto assignment to @trjExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.Bug0 Triage Checklist (Main S/O)
- This "bug" occurs on a supported platform (ensure
Platformsin 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
- This "bug" occurs on a supported platform (ensure
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.currentUserPersonalDetailsinTimezoneSelectPageso we just need to navigate back to timezone initial page from the timezone select page whenever- User updates their timezone to automatic from another device
- 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
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.currentUserPersonalDetailsinTimezoneSelectPageso we just need to navigate back to timezone initial page from the timezone select page whenever- User updates their timezone to automatic from another device
- 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
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
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 :
- The list is migrated from
OptionsSelectortoSelectionListRadio
The timezone is disabled if the automatic timezone is on here:
sections={[{data: timezoneOptions, indexOffset: 0, isDisabled: timezone.current.automatic}]}
OptionsSelectorusesOptionsListwhich rendersOptionRowas its item and it will have a condition to disable theOptionRow. We can basically disable it by disabling the whole list (props.isDisabled), each section (section.isDisabled), or each item (item.isDisabled)
App/src/components/OptionsList/BaseOptionsList.js
Lines 162 to 174 in a03a21d
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
SelectionListRadiodon't have a condition to disable its item (RadioListItem).
App/src/components/SelectionListRadio/BaseSelectionListRadio.js
Lines 160 to 170 in a03a21d
const renderItem = ({item, index, section}) => { const isFocused = focusedIndex === index + lodashGet(section, 'indexOffset', 0); return ( <RadioListItem item={item} isFocused={isFocused} onSelectRow={props.onSelectRow} /> ); }; - 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?
- 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.
App/src/components/SelectionListRadio/RadioListItem.js
Lines 29 to 33 in a03a21d
function RadioListItem(props) { return ( <PressableWithFeedback onPress={() => props.onSelectRow(props.item)} accessibilityLabel={props.item.text} I only use
section.isDisabledfor the disabled condition because only the timezone list that usesSelectionListRadioand the disabled state is on thesectionobject.- Don't use ref for the
timezoneobject
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); - The list is migrated from
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.
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Aug 14, 2023 - 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 Job added to Upwork: https://www.upwork.com/jobs/~01b0a8cd3364d19ad6
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Aug 14, 2023 Current assignee @trjExpensify is eligible for the External assigner, not assigning anyone new.
32 remaining items
If you're waiting for price confirmation:
1.5k (original price stated on GH title plus efficiency bonus applies based on #24516 (comment))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 bonusOffers sent!
@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.
@bernhardoj - paid!
@huzaifa-99 - paid!
@0xmiroslav - waiting on you now.Reacted by Huzaifa Rasheed- 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 @trjExpensify, @mountiny, @bernhardoj, @0xmiroslav Eep! 4 days overdue now. Issues have feelings too...
Not overdue
@0xmiroslav like the other issue, if you're tracking this somewhere else. I'm going to close it!
Reacted by 0xmiroslav
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:
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?
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