Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.57k stars 2.91k forks source link

[$250] Wrong page when navigating back from access level page #52904

Open m-natarajan opened 17 hours ago

m-natarajan commented 17 hours ago

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


Version Number: 9.0.64-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: 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 Expensify/Expensify Issue URL: Issue reported by: @DylanDylann Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs

Action Performed:

  1. Go To Security Page
  2. Add Copilot
  3. Click on any user
  4. Click on "FULL" access
  5. Click on access level row
  6. Click back button

    Expected Result:

    The App navigate to confirmation page

    Actual Result:

    The App navigate to the user selection page

    Workaround:

    Unknown

    Platforms:

    Which of our officially supported platforms is this issue occurring on?

    • [ ] Android: Standalone
    • [ ] Android: HybridApp
    • [ ] Android: mWeb Chrome
    • [ ] iOS: Standalone
    • [ ] iOS: HybridApp
    • [ ] iOS: mWeb Safari
    • [x] MacOS: Chrome / Safari
    • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/7208ba74-b52d-451c-bb0b-33048043c9cb

https://github.com/user-attachments/assets/b8e5560e-c153-4e1d-a365-02b3dfbe2820

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021859633840404147585
  • Upwork Job ID: 1859633840404147585
  • Last Price Increase: 2024-11-21
Issue OwnerCurrent Issue Owner: @eVoloshchak
melvin-bot[bot] commented 17 hours ago

Triggered auto assignment to @puneetlath (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

NJ-2020 commented 17 hours ago

Proposal

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

What is the root cause of that problem?

Right here we go back to add delegate page instead of going back or passing the back to param https://github.com/Expensify/App/blob/4c44827398f884af626872c33f64dd358d19eff4/src/pages/settings/Security/AddDelegate/SelectDelegateRolePage.tsx#L37-L39

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

We can just invoke the goBack without passing any fallback route

onBackButtonPress={() => Navigation.goBack()}

Or we can pass the backTo param as the fallback route

We can do the same approach for other pages if needed

What alternative solutions did you explore? (Optional)

nkdengineer commented 17 hours ago

Edited by proposal-police: This proposal was edited at 2024-11-21 13:46:08 UTC.

Proposal

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

Wrong page when navigating back from access level page

What is the root cause of that problem?

While we are on the role page by selecting the role at the confirmation page and navigate here

https://github.com/Expensify/App/blob/00a81dc63f265a9f90a29f2d744a70465924f7f1/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx#L73

nav stack: [user page, role page]

Then we click to back button, it will navigate to the user selection page here.

https://github.com/Expensify/App/blob/00a81dc63f265a9f90a29f2d744a70465924f7f1/src/pages/settings/Security/AddDelegate/SelectDelegateRolePage.tsx#L39

Because we use NAVIGATE, it will go back to the page that is already in the stack.

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

We should do the same way we did with approver flow here, here.

Add type PUSH to this navigation

    onPress={() => Navigation.navigate(ROUTES.SETTINGS_DELEGATE_ROLE.getRoute(login, role), CONST.NAVIGATION.ACTION_TYPE.PUSH)}

https://github.com/Expensify/App/blob/00a81dc63f265a9f90a29f2d744a70465924f7f1/src/pages/settings/Security/AddDelegate/ConfirmDelegatePage.tsx#L54

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 14 hours ago

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

melvin-bot[bot] commented 14 hours ago

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