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

Error cannot fetch your preferences when not logged in #464

Open
bourgeoa opened this issue Jan 8, 2022 · 9 comments
Open

Error cannot fetch your preferences when not logged in #464

bourgeoa opened this issue Jan 8, 2022 · 9 comments
Labels
bug priority-high to be used for important issues and pull requests that need to be addressed soon

Comments

@bourgeoa
Copy link
Contributor

bourgeoa commented Jan 8, 2022

Unable to fetch your preferences - this was the error:  Error: (via loadPrefs) Error: Can't log in: Error: Could not log in
    at _callee5$ (authn.ts:288)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:294)
    at Generator.throw (runtime.js:119)
    at asyncGeneratorStep (asyncToGenerator.js:3)
    at _throw (asyncToGenerator.js:29)

The error is raised in https://github.com/solid/solid-ui/blob/6a9e81a980072cb7f7b8e8098346bd1acac55269/src/authn/authn.ts#L219

This is caused by calling solidLogicSingelton without being logged in

@bourgeoa bourgeoa added the bug label Jan 8, 2022
@SharonStrats
Copy link
Contributor

SharonStrats commented Jan 9, 2022

Hi @bourgeoa I'm wondering what would the expected behavior be? Should we just be told that we are not logged in?

I also can't seem to recreate it. I'm wondering if you could show the steps you took to produce it. I logged in, went to preferences, logged out and it just refreshes and goes to my public data.

@bourgeoa
Copy link
Contributor Author

bourgeoa commented Jan 9, 2022

what would the expected behavior be? Should we just be told that we are not logged in?

@SharonStrats Profile and public preferences should be available.

I also can't seem to recreate it. I'm wondering if you could show the steps you took to produce it. I logged in, went to preferences, logged out and it just refreshes and goes to my public data.

Logging out do not clear public preferences

@ewingson
Copy link
Member

ewingson commented Jan 9, 2022

@bourgeoa @SharonStrats

maybe this is a good first issue to wrap my head around.
I' m trying to reproduce it. being not logged in and opening the settings container throws a 401 (see pic).

what is the desired behaviour ? being in which state and doing what exact steps shows the error ?
where would the public preferences be meant to be shown ?

Bildschirmfoto_2022-01-09_11-31-32

@bourgeoa
Copy link
Contributor Author

bourgeoa commented Jan 9, 2022

@ewingson
The error appears in the browser developper :
image

@ewingson
Copy link
Member

ewingson commented Jan 9, 2022

@bourgeoa @SharonStrats

I was able to reproduce it (see pic).
Alain, you already tracked it down fortunately.
Dunno though if the code seems to trigger (or need) a Login.

maybe we must remove (or modify) the triggering mechanism solidLogicSingelton.
Bildschirmfoto_2022-01-09_13-12-44

@ewingson
Copy link
Member

ewingson commented Jan 9, 2022

@bourgeoa @SharonStrats

I tried to follow the code flow.
to me the console says Line 288. ((see two pics)).
Bildschirmfoto_2022-01-09_14-07-58
Bildschirmfoto_2022-01-09_14-07-12

@timea-solid timea-solid added the priority-high to be used for important issues and pull requests that need to be addressed soon label Mar 31, 2022
@timea-solid
Copy link
Member

timea-solid commented Apr 26, 2022

Since we are not logged in, it should not even try to read the preference file. The check to see if the user is logged in should happen before, in the code. @jeff-zucker am I correct to say that the app should not even look for it?

@jeff-zucker
Copy link
Contributor

Yes, I believe that is correct, the preferencesFile is private and can only be accessed when logged in so there is no point in looking for it if not logged in. I believe the correct behavior is

  1. Load the WebID Profile Document
  2. If logged in, load the preferences file
    2a. If no preferences file found, offer to create one
  3. If not logged in, perhaps informative message in console :"not logged in, no preferences loaded"

@timea-solid
Copy link
Member

This was also discussed in SolidOS team meeting (see under tech topics).
Same steps as Jeff mentioned a bit more implementation detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority-high to be used for important issues and pull requests that need to be addressed soon
Projects
Status: No status
Development

No branches or pull requests

5 participants