Where is the yjs doc stored?

Hello everyone. I am using yjs with y-websocket to create a real-time collaborative image annotating tool. I am most probably using yjs wrong but here is my problem. I store each user’s current drawing box in their awareness and when the box is done being drawn it is stored in a yjs array. I want to be able to clear the yjs doc for for development. I have not set any persistence through y-websocket, nor somewhere else but it seems that the only thing that clears the yjs doc is restarting my pc. I have also tried clearing the browser cache but nothing changes. Any ideas? Thank you in advance.

I do not yet know y-websocket in detail, but it could be that y-websocket keeps some Yjs updates in memory in order to submit them to future connecting clients.

Have you tried to restart your y-websocket server between your runs? or simply choose another “room name”?

@loukaspapalazarou Assuming your only provider is y-websocket, you should shut down the server, then refresh/close the page, then restart the server. If either the page or the server are still open, the Doc will re-sync as soon as it reconnects.

I tried restarting the server but as @raine pointed out I did not also refresh the browser. I think chosing a different room name would hide the problem but when going back to the original, the same problem would occur.

That seems to work! Thank you @raine, it never occured to me to refresh the browser after closing the server.

1 Like