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

Fix double login in specific cases #4568

Merged
merged 3 commits into from
Sep 16, 2022
Merged

Fix double login in specific cases #4568

merged 3 commits into from
Sep 16, 2022

Conversation

charlag
Copy link
Contributor

@charlag charlag commented Sep 9, 2022

Double login could occur if LoginView would start the normal login process and then the URL would change (e.g. when native part would change trigger login with specific account). In this case a second LoginView would be constructed and would start the login on its own. Normally this shouldn't happen but for LoginView we specifically opted into not caching it to not accidentally hold to credentials any longer than necessary.

To prevent this issue we should not create LoginView manually but let mithril do it. This is a bit tricky as LoginView needs some info passed into it. We ended up rewriting LoginView as a proper component and creating a new RouteResolver implementation that can work with this type of views.

fix #4554
fix #4570

also see the same branch for admin client

Double login could occur if LoginView would start the normal login
process and then the URL would change (e.g. when native part would
change trigger login with specific account). In this case a second
LoginView would be constructed and would start the login on its own.
Normally this shouldn't happen but for LoginView we specifically
opted into not caching it to not accidentally hold to credentials any
longer than necessary.

To prevent this issue we should not create LoginView manually but let
mithril do it. This is a bit tricky as LoginView needs some info passed
into it. We ended up rewriting LoginView as a proper component and
creating a new RouteResolver implementation that can work with this
type of views.

fix #4554
Stream.map() callback would be called immediately during setViewModel()
because of how streams are implemented, and we would try to do
m.redraw.sync() inside of another redraw.

Now we schedule a microtask after the current redraw.

fix #4570
@charlag charlag modified the milestone: 3.100.1 Sep 15, 2022
@charlag charlag merged commit 319520c into master Sep 16, 2022
@charlag charlag deleted the fix-double-login-4554 branch September 16, 2022 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switching from search to mail viewer produces a silent error Parallel login on Android
2 participants