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

Launching the app from a deeplink does not open the specific stack of routes every time #1668

Open
MartinAKovachev opened this issue Aug 1, 2023 · 10 comments

Comments

@MartinAKovachev
Copy link

MartinAKovachev commented Aug 1, 2023

Hi @Milad-Akarie,
Me and my team noticed strange behaviour on iOS platform.
We are using the deepLinkBuilder and based on the received PlatformDeepLink, we might create a new DeepLink or return the PlatformDeepLink.

e.g.

final newDeepLink = DeepLink([
          const MainRoute(),
          InfoRoute(id: id),
        ]);

2 out of 10 times, opening a deeplink, while the application is closed (removed from memory/ cold started) the user is not navigated to the correct route.

We recorded the screen flow and we actually noticed that, the application initially navigates correctly to the MainRoute, then to the InfoRoute, but after a while it navigates to the MainRoute (path '/') again (replacing the whole stack with the MainRoute).

As we said it happens 2-3 times out of 10 but it's still an issue for the user experience.

@Milad-Akarie
Copy link
Owner

@MartinAKovachev can you confirm if this happens in release builds?

@MartinAKovachev
Copy link
Author

@MartinAKovachev can you confirm if this happens in release builds?

@Milad-Akarie It happens in debug and release builds.

@Milad-Akarie
Copy link
Owner

Hey @MartinAKovachev I can't seem to reproduce this. any notes on how it may be reproduced?

@MartinAKovachev
Copy link
Author

MartinAKovachev commented Sep 5, 2023

Hey @Milad-Akarie, I'm sorry for the late reply. We also have a guard (LoggedInUserGuard) to the routes (MainRoute and InfoRoute) to which we navigate the user. In the onNavigation method we have an asynchronous method call (you can add a Future.delay of 5 sec just for the test). Our deepLinkBuilder method is also asynchronous.
This is what happens when we open the deep link from iOS notes several times (2/10) and the issue appears:

The user clicks in iOS notes on 'https://www.test-app.com/info?id=1' link

The app is cold started

  1. deepLinkBuilder receives '/' (which corresponds to MainRoute in our app)
  2. We return the initial '/' deepLink object from deepLinkBuilder method
  3. LoggedInUserGuard.onNavigation method handles it.
  4. The asynchronous method inside the guard is called.
  5. deepLinkBuilder receives a new '/info?id=1''
  6. We build a new DeepLink object in the deepLinkBuilder and return DeepLink([const MainRoute(), InfoRoute(id: 1)]);
  7. LoggedInUserGuard.onNavigation method handles MainRoute from the new deepLink object (step 6)
  8. The asynchronous method inside the guard is called.
  9. resolver.next() inside the guard is called.
  10. LoggedInUserGuard.onNavigation method handles InfoRoute from the new deepLink object (step 6)
  11. The asynchronous method inside the guard is called.
  12. resolver.next() inside the guard is called.
  13. !!! resolver.next() is called from the initial '/' deepLink object (the initial route). (step 2)

So the user sees for a second InfoRoute and then the MainRoute reappears.

@MartinAKovachev
Copy link
Author

MartinAKovachev commented Oct 2, 2023

@Milad-Akarie May I ask if there are any updates?

@MartinAKovachev
Copy link
Author

Seems the issue is left behind but more and more developers noticed it. @Milad-Akarie Do you think this issue might be picked up soon?

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

@Vikrech
Copy link

Vikrech commented Dec 4, 2023

Good day, everyone. I recently came across an interesting open Flutter issue #89662, which might potentially be the root cause of this problem.
@Milad-Akarie, is there any chance you could confirm that?

Copy link

github-actions bot commented Jan 5, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants