jupyterlab/jupyter-collaboration

Specify Y-WebSocket endpoint path

Opened this issue · 0 comments

Problem

We already have some kind of ad-hoc schema for the WebSocket endpoint path, e.g.:

  • /api/collaboration/room/json:notebook:{document_id}: for connecting to a notebook.
  • /api/collaboration/room/text:file:{document_id}: for connecting to a text file.
  • /api/collaboration/room/JupyterLab:globalAwareness: for connecting to the "awareness".

If we wanted to have collaborative widgets, or directory content, we could have:

  • /api/collaboration/room/ywidget:{widget_id}: for connecting to a collaborative widget.
  • /api/collaboration/room/drive:{drive_id}: for connecting to a drive.

We currently assume that if an endpoint path has two colons (like json:notebook:{document_id} or text:file:{document_id}), then the corresponding shared document is file-backed (that's how we dump files to disk). And we assume that if an endpoint path has only one colon (like /api/collaboration/room/JupyterLab:globalAwareness), then it is a "transient" document that is not file-backed. Widgets would not be file-backed, but drives would be, although maybe not in the sense of a regular file that needs to talk to the file ID service.

Proposed Solution

We should normalize the structure of the Y-WebSocket endpoint paths. The number of colons doesn't seem to be a solid solution, and we should probably have a field saying if the document is file-backed.

cc @ellisonbg