How can I listen for new messages in my Inbox


#1

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.

Am I missing something here?


#2

Have you checked the Solid Websockets spec? It might help you (sorry I can’t help you further)


#3

can you try the following?

sub https://user1.solid.community/inbox/

(spot the trailing slash I added)


#5

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.


#6

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.


#7

Is there somewhere I should report this as an issue?


#8

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


#9

There’s already an issue at the node-solid-server about this: https://github.com/solid/node-solid-server/issues/933

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.


#10

But you would have to write to the “log.ttl” document on the other user’s POD for this to work? If so, is there a way of doing that?


#11

Scratch that question. I have just discovered the WAC spec!