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

[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

Closed
1 of 6 tasks
m-natarajan opened this issue Aug 13, 2023 · 33 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

@m-natarajan
Copy link

m-natarajan commented Aug 13, 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. 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
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 13, 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

@m-natarajan
Copy link
Author

m-natarajan commented Aug 13, 2023

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

@huzaifa-99
Copy link
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

@ahmedGaber93
Copy link
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

@bernhardoj
Copy link
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);

@trjExpensify
Copy link
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.

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Aug 14, 2023
@melvin-bot melvin-bot bot 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 Aug 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 14, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01b0a8cd3364d19ad6

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

melvin-bot bot commented Aug 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 14, 2023

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

@trjExpensify
Copy link
Contributor

Let us know what you think about these proposals, @0xmiroslav!

@0xmiros
Copy link
Contributor

0xmiros commented Aug 15, 2023

I agree with @bernhardoj to fix regression so that list is disabled again. There was discussion about the expected behavior - https://expensify.slack.com/archives/C01GTK53T8Q/p1675722834448009 while fixing original issue.
Working demo video is in original PR.
@bernhardoj's proposal looks good to me.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Aug 15, 2023

Triggered auto assignment to @mountiny, 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 Aug 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 15, 2023

📣 @0xmiroslav We're missing your Upwork ID to automatically send you an offer for the Reviewer role.
Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!

@melvin-bot
Copy link

melvin-bot bot commented Aug 15, 2023

📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@mountiny
Copy link
Contributor

Thanks Miroslav

@bernhardoj can you make the pr please

@melvin-bot
Copy link

melvin-bot bot commented Aug 15, 2023

📣 @huzaifa-99 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@mountiny
Copy link
Contributor

Yeah I agree, bonus can be applied here cc @trjExpensify

@trjExpensify
Copy link
Contributor

Sounds good. :)

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

This issue has not been updated in over 15 days. @trjExpensify, @mountiny, @bernhardoj, @0xmiroslav 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!

@mountiny mountiny added Daily KSv2 and removed Monthly KSv2 Reviewing Has a PR in review labels Sep 14, 2023
@mountiny
Copy link
Contributor

@bernhardoj @0xmiroslav seems like the automation failed here and this is ready for payment, can you summarize the prices here please?

@mountiny mountiny added the Awaiting Payment Auto-added when associated PR is deployed to production label Sep 14, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

@trjExpensify, @mountiny, @bernhardoj, @0xmiroslav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@trjExpensify
Copy link
Contributor

bump @bernhardoj @0xmiroslav

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Sep 18, 2023

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

@trjExpensify
Copy link
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!

@huzaifa-99
Copy link
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.

@trjExpensify
Copy link
Contributor

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

@trjExpensify trjExpensify 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 Sep 19, 2023
@trjExpensify trjExpensify added Weekly KSv2 and removed Daily KSv2 labels Sep 19, 2023
@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@0xmiros
Copy link
Contributor

0xmiros commented Sep 26, 2023

Not overdue

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2023
@trjExpensify
Copy link
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
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

7 participants