SolidOS / chat-pane

Solid-compatible chat discussion applet for solid-panes framework
MIT License
10 stars 4 forks source link

Cannot load SolidOS team chat when logged in #48

Open angelo-v opened 4 years ago

angelo-v commented 4 years ago

While being logged in as https://angelo.veltens.org/profile/card#me I cannot open the SolidOS Team Chat

image

Browser Console:

Complaint: Error: Error recording your partipation: Exception in update: Error: Update: Can't make changes in uneditable <https://solidos.solid.community/Team/SolidOs%20team%20chat/index.ttl>
Error: Update: Can't make changes in uneditable <https://solidos.solid.community/Team/SolidOs%20team%20chat/index.ttl>
  undefined
    Error: Update: Can't make changes in uneditable <https://solidos.solid.community/Team/SolidOs%20team%20chat/index.ttl>  undefined
        at e.value (https://solidos.solid.community/mashlib.min.js:1:27185)  undefined
        at https://solidos.solid.community/mashlib.min.js:19:7918  undefined
        at new Promise (<anonymous>)  undefined
        at Object.u.pad.participationObject (https://solidos.solid.community/mashlib.min.js:19:7438)  undefined
        at https://solidos.solid.community/mashlib.min.js:128:321833

It works when I load the page while not being logged in and then log in, but as soon as I reload the page the error occurs again.

angelo-v commented 4 years ago

Just noticed, that even in the latter case, I am not able to send a message

image

timbl commented 4 years ago

Interesting problem with caching maybe. Looks like maybe you loaded the data when not logged in and your local quad store saved the response. Then you log in. Then you try to modify the same document and it checks in the store whether we have information on whether we. Have write access and it says yes we have info and no we don’t have write. So we need a way of invalidating or retrying that data — or 403 or 401 errors For that matter — which predate your login.

angelo-v commented 4 years ago

Indeed, the GET request for the chat document does not send an Authorization header and the response contains Link header WAC-Allow: user="read",public="read"

Shouldn't he chat be fetched after the authentication took place?

timbl commented 3 years ago

When you initially go to the chat, you may be logged in or not. If you are not logged in, you can read the chat, but the message composition box is replaced with a login button, so you can't sent messages anyway. At that point there is a fetch with metadata saying that the chat file is not editable. Unfortunately if you the log in, that HTTP metadata the WAC-Allow data I guess, is used even though it is out of date. Because of RDF lib #441. It needs to know to ignore metadat from before the last login state change, which will cause it to fetch again if it needs to. (Or it may already have another request it can use, from since the login).

SharonStrats commented 1 year ago

@angelo-v We are thinking this has been resolved?