nodeSolidServer / nodeSolidServer/node-solid-server

Server sends phantom WebSocket pub messages

Aperta
#1,587 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
JavaScript
Stelle
1.8k
Fork
308
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Based on the spec (https://github.com/solid/solid-spec/blob/master/api-websockets.md#subscription), client can subscribe and the server will send WebSocket pub messages on CRUD operations. I use this for inbox monitoring - notify user about new messages in his Solid inbox. So when anybody POSTs to his inbox, solid server sends WS pub message to my application, this works fine.

However, there are "phantom" WS pub messages even when there is no user-triggered CRUD operation on the inbox. From the spec, it should be only when POST, PUT, PATCH or, DELETE happens on the source.

Now, this is hard to debug/investigate. But I can reproduce it, using my application https://whyineedtofillusername.github.io/inbox/:

  1. login using WebID
  2. send a message to any other WebID (lastly I tried sending messages between https://inbox1.inrupt.net/profile/card#me and https://inbox4.inrupt.net/profile/card#me, using Activity Streams message functionality; one in Chrome and the other user in Firefox)
  • the only request the application does is this POST request (copied from Chrome, user Inbox1 sending message to user Inbox4):
POST /inbox/ HTTP/1.1
Host: inbox4.inrupt.net
Connection: keep-alive
Content-Length: 437
sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"
Accept: application/json, text/plain, */*
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Content-Type: application/ld+json
Origin: https://whyineedtofillusername.github.io
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://whyineedtofillusername.github.io/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9

{..} (json payload)

The request above produces WS message

pub https://inbox1.inrupt.net/inbox/

image

Now there shouldn't be any reason for this, but it looks like the solid server is doing some CRUD operation on the sender's inbox as well. Is this intentional? When I compare the RDF for https://inbox1.inrupt.net/inbox/ before and after sending the message, there is no change (not even the "terms:modified" has changed). So it doesn't look like there's been any CRUD operation on the source.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il POST segnalato alla casella di posta in arrivo del destinatario e traccia la gestione della pubblicazione WebSocket del server per i messaggi pub risultanti. Confronta lo stato della casella di posta in arrivo e i percorsi delle richieste del mittente e del destinatario, quindi verifica che le notifiche vengano emesse solo per la risorsa la cui operazione CRUD è cambiata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.