App: [HOLD for payment 2023-09-18] [$1000] Deeplinks except chat reports are not working on web

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:

Break down in numbered steps

  1. Log out
  2. Go to any app URL (/enable-payments) or /concierge or some other deeplink activated route
  3. Log in

Expected Result:

Describe what you think should’ve happened

You are signed in and logged into that route

Actual Result:

Describe what actually happened

You are in normal chat report/ not deeplinked to the page you wanted

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

https://github.com/Expensify/App/assets/36083550/1de36497-4b8f-4eaf-920f-5531d3414db5

Expensify/Expensify Issue URL: Issue reported by: @tienifr Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693478978353389

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fe24c8c7021a0486
  • Upwork Job ID: 1699316717752012800
  • Last Price Increase: 2023-09-06
  • Automatic offers:
    • hungvu193 | Contributor | 26522318
    • tienifr | Reporter | 26522320

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 59 (36 by maintainers)

Most upvoted comments

@abekkala @parasharrajat is the C+ who worked with me on the PR.

Feel free to make a proposal, @adamgrzybowski for review

Thanks everyone!

No, I will do that later. Feel free to close if you want.

@tienifr and @hungvu193 payments have been made and contracts ended. Thank you! 🎉

@parasharrajat have you already requested manually payment in EChat yet?

Yeah, I reviewed the PR. @abekkala Please assign me as C+ and swap with @eVoloshchak.

@sumairq they will respond to you and the invite will be handled that way, thanks for patience

I see, I think there is lots of flows related to the concierge as well as transition from oldDot when clicking the concierge widget, I think that might also be influenced by this change

In that case I think we can keep that logic separate if in this PR the chat will eventually go to the correct concirge chat

@mountiny @b4s36t4 I’ve done some testing and it looks like navigationRef.getRootState() to navigationRef.getState() can give different results.

In some cases, I can see that the state from navigationRef.getState() is lacking state for nested navigators

I am not sure why though.

I would be cautious with switching to getState()

https://github.com/Expensify/App/blob/1c8eaa7ca3303c1654b094f6fbaa94bc0c5787fb/src/libs/Navigation/NavigationRoot.js#L79 I have updated this line from navigationRef.getRootState() to navigationRef.getState() it is working perfectly.

I haven’t worked on RCA yet though.

Proposal

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

Deeplinks except chat reports are not working on web

What is the root cause of that problem?

This useEffect run right after navigation is ready wipe out the navigation state, so we couldn’t navigate to the pending route. https://github.com/Expensify/App/blob/1bdc5acc12f982b4f6e37bfadf9060ac3d2d3b3c/src/libs/Navigation/NavigationRoot.js#L74-L80

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

We shouldn’t reset root for unauthorized route, because we also have anonymous user, pending route after logging in, so we should add more condition here:

    useEffect(() => {
        if (!navigationRef.isReady() || !props.authenticated) {
            return;
        }
        // We need to force state rehydration so the CustomRouter can add the CentralPaneNavigator route if necessary.
        navigationRef.resetRoot(navigationRef.getRootState());
    }, [isSmallScreenWidth, props.authenticated]);

What alternative solutions did you explore? (Optional)

N/A