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

Logging in freezes the UI #18

Open
NoelDeMartin opened this issue Jan 16, 2021 · 1 comment
Open

Logging in freezes the UI #18

NoelDeMartin opened this issue Jan 16, 2021 · 1 comment

Comments

@NoelDeMartin
Copy link

There are some situations where the UI is frozen for a couple of seconds after calling the login method. I'm not sure why it happens, and sometimes it works properly on subsequent logins so maybe it has something to do with data stored in the browser.

To reproduce this, you can visit ramen.noeldemartin.com, click on "try using a different authentication method" and select "Log in using the community authentication library". I have tried both in Firefox and Chrome, and it's more accentuated using Firefox.

If this isn't a bug I think it'd be nice to provide an API that allows calling login within a web worker that wouldn't block the UI. Which I know is not easy as it sounds, because web workers need to be served on a different file. Just throwing ideas :).

@josephguillaume
Copy link

I can see the animation pause, and my guess is that it's related to localStorage.
Some profiling would be needed to work out which storage calls are noticeable to the user, but this potentially seems like a good starting point:
https://github.com/solid/solid-auth-fetcher/blob/1407fb9dacdfa8bf0cd31f397161ae27ce980704/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts#L81

setForUser is re-writing userData for each key, whereas it could just be done once.
https://github.com/solid/solid-auth-fetcher/blob/1407fb9dacdfa8bf0cd31f397161ae27ce980704/src/localStorage/StorageUtility.ts#L125-L129

If that doesn't sufficiently fix the issue, this might not be high priority given this is not the preferred auth solution and it's not a particularly long pause (at least on my system).

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

No branches or pull requests

2 participants