I want to listen for new messages in my inbox. I have tried doing the following (for a hypothetical “user1”):
Open a web socket at “wss://user1.solid.community”
Send the following string: “sub https://user1.solid.community/inbox”
Listen for incoming messages
But when something is sent to my Inbox I do not receive anything on the socket. And I have confirmed that the new documents are being placed in the inbox folder.
I am getting a lot of erratic behaviour when it comes to the WebSockets API. I put the most basic example on jsFiddle to monitor the inbox for my own Solid account. When I post a new message to my Inbox then I do NOT receive any updates. However if I go to the Solid Filemanager and then delete these files then I DO receive the pub messages.
I have also done some testing on websocket.org and that has also behaved in a very erratic way. Sometimes it works sometimes it doesn’t.
So the only conclusion I can draw at this stage is that the WebSockets API cannot be relied upon - at least when it comes to monitoring a container - I haven’t done any testing yet on monitoring a document.
hmm wierd, sorry cannot tell, did not use the websocket API so far besides tiny experiment. Might be a Bug in NSS, perhaps you can find an open issue there, or file one otherwise.
Yes I can, 'i’ve tested but sadly the websocket don’t work on folder, only on files, so what I do is a simple log.ttl where I put a new triple in the same time that when I post to inbox & I subscribe to change in that log.ttl file. Not optimal but that folks
When using websockets on a folder, I don’t get pub messages when a file is added to that folder. However, it would nice to have such a feature. For example, to detect if new notifications arrive in the inbox of a user.