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.36k stars 2.79k forks source link

[PAID] [$250] Settings - A new user can navigate away from the onboarding modal using an URL #45260

Closed izarutskaya closed 2 months ago

izarutskaya commented 2 months 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.6-0 Reproducible in staging?: Y Reproducible in production?: Y Found when executing PR : https://github.com/Expensify/App/pull/44536 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

  1. Open the app
  2. Log in with a new Gmail user
  3. Open https://staging.new.expensify.com/settings/profile URL "in New Expensify"
  4. Tap on the "<" button to navigate back

Expected Result:

The onboarding modal should be showing when opening a different URL until the onboarding is completed.

Actual Result:

A new user can navigate away from the onboarding modal using an URL. The onboarding can't be skipped as its shown again when navigating back from the opened page.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/1dde4238-d698-4c36-a02b-568d6da006c8

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a6951dbdae386a31
  • Upwork Job ID: 1812979942020839461
  • Last Price Increase: 2024-07-15
  • Automatic offers:
    • nkdengineer | Contributor | 103158696
Issue OwnerCurrent Issue Owner: @strepanier03
melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @strepanier03 (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.

izarutskaya commented 2 months ago

We think this issue might be related to the #collect project.

strepanier03 commented 2 months ago

Able to repro this using a Pixel 6 pro on Native.

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

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

nkdengineer commented 2 months ago

Proposal

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

A new user can navigate away from the onboarding modal using an URL. The onboarding can't be skipped as its shown again when navigating back from the opened page.

What is the root cause of that problem?

We have a useEffect to navigate to the onboarding flow if it's not complete but this only triggers when isLoadingApp is changed and isLoadingApp is only changed after OpenApp API is called. So when we open the deep link and we already login, we navigate to the deep link page.

https://github.com/Expensify/App/blob/fb9ce79f891ef932c60c36617162f5e988e3313d/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.tsx#L62

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

For the web, when we access via deep link the page is reloaded and the useEffect is triggered and the bug doesn't happen.

https://github.com/Expensify/App/blob/fb9ce79f891ef932c60c36617162f5e988e3313d/src/libs/Navigation/AppNavigator/createCustomBottomTabNavigator/BottomTabBar/index.tsx#L62

For natives, we have the logic to listen to the deep link here. We can navigate to the onboarding flow in the openReportFromDeepLink function if it's not completed here

if (isAuthenticated) {
    Welcome.isOnboardingFlowCompleted({onNotCompleted: () => Navigation.navigate(ROUTES.ONBOARDING_ROOT)});
    return;
}

https://github.com/Expensify/App/blob/fb9ce79f891ef932c60c36617162f5e988e3313d/src/libs/actions/Report.ts#L2598-L2599

What alternative solutions did you explore? (Optional)

NA

Result

https://github.com/user-attachments/assets/a92b54ea-016a-4ceb-a8d8-5f335d9dca3e

Ollyws commented 2 months ago

@nkdengineer's proposal LGTM. πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 2 months ago

πŸ“£ @nkdengineer πŸŽ‰ 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 πŸ“–

melvin-bot[bot] commented 2 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 2 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.11-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-01. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 2 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

Ollyws commented 2 months ago

BugZero Checklist:

  • [x] The PR that introduced the bug has been identified. Link to the PR:

https://github.com/Expensify/App/pull/35019

  • [x] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

https://github.com/Expensify/App/commit/867be1578e7960f0c68563ca615f41f614338e8c#r144801956

  • [x] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

N/A

  • [x] Determine if we should create a regression test for this bug.

Yes

  • [x] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

1. Open the app
2. Login with a new Gmail user
3. Open /settings/profile
4. Verify that: The onboarding modal should be showing when opening a different URL until the onboarding is completed.

Do we agree πŸ‘ or πŸ‘Ž

Ollyws commented 2 months ago

Requested in ND.

strepanier03 commented 2 months ago

Payment Summary

@JmillsExpensify - Request incoming.

strepanier03 commented 2 months ago

Working on reg test gh now.

JmillsExpensify commented 2 months ago

$250 approved for @Ollyws

strepanier03 commented 2 months ago

Thanks all, this is paid and reg test is done, closing out!