uno.extensions icon indicating copy to clipboard operation
uno.extensions copied to clipboard

[Navigation] Flicker or Splashscreen showing when logging out

Open nickrandolph opened this issue 3 years ago • 1 comments

There are a couple of different scenarios for when there's flickering and/or splashscreen showing around the use of login pages

Typical application structure:

  • Login
  • Home
    • NavigationView to switch between views

Current behavior

  1. If one of the pages loaded inside the NavigationView contains a Logout button, the route needs to be /Login which essentially restarts the navigation of the app, causing a flicker and/or shows the splashscreen for a short time.

This is in part due to some apps attaching to either ITokenCache.Cleared or IAuthenticationService.LoggedOut and navigating to Login as well as navigating to /Login after calling IAuthenticationService.LogoutAsync

  1. If on the Login, an attempt is made to authenticate by calling IAuthenticationService.LoginAsync, but login fails, there is a flicker as the Login page is refreshed (this is made worse if the app decides to show a dialog to prompt the user about login fail). This is again caused by attaching to either ITokenCache.Cleared or IAuthenticationService.LoggedOut and navigating to Login (as if the user had logged out of the app)

Expected behavior

  1. Navigation should be able to call -/Login which will forward navigate from Home to Login and then clear backstack
  2. Navigating to Login in either ITokenCache.Cleared or IAuthenticationService.LoggedOut shouldn't regenerate the FrameView, they should navigate to Login view and then clear backstack ITokenCache.Cleared and IAuthenticationService.LoggedOut shouldn't be called if the user isn't logged in, when attempting to login

How to reproduce it (as minimally and precisely as possible)

https://github.com/unoplatform/uno.extensions/pull/743 -> Commerce sample in the TestHarness has both Logout options to demonstrate this issue

nickrandolph avatar Sep 20 '22 06:09 nickrandolph

@nickrandolph is this still the case lately? (cc @eriklimakc)

agneszitte avatar May 24 '24 15:05 agneszitte