Skip to content

Commit

Permalink
Backport 'Update pycrdt-websocket v0.13.0' jupyterlab#293 (jupyterlab…
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer authored May 1, 2024
1 parent b49bc4f commit f284083
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jupyter_collaboration/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ async def _clean_room(self) -> None:
async with self._room_lock(self._room_id):
# Remove the room from the websocket server
self.log.info("Deleting Y document from memory: %s", self._room_id)
self._websocket_server.delete_room(room=self.room)
await self._websocket_server.delete_room(room=self.room)

# Clean room
del self.room
Expand Down
4 changes: 2 additions & 2 deletions jupyter_collaboration/rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ def _emit(self, level: LogLevel, action: str | None = None, msg: str | None = No

self._logger.emit(schema_id=JUPYTER_COLLABORATION_EVENTS_URI, data=data)

def stop(self) -> None:
async def stop(self) -> None:
"""
Stop the room.
Cancels the save task and unsubscribes from the file.
"""
super().stop()
await super().stop()
# TODO: Should we cancel or wait ?
if self._saving_document:
self._saving_document.cancel()
Expand Down
2 changes: 1 addition & 1 deletion jupyter_collaboration/websocketserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def clean(self):
# self.log.warning(msg)
# self.log.debug("Pending tasks: %r", pending)

self.stop()
await self.stop()
tasks = []
if self.monitor_task is not None:
self.monitor_task.cancel()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = [
dependencies = [
"jupyter_server>=2.0.0,<3.0.0",
"jupyter_ydoc>=2.0.0,<3.0.0",
"pycrdt-websocket>=0.12.5,<0.13.0",
"pycrdt-websocket>=0.13.0,<0.14.0",
"jupyter_events>=0.10.0",
"jupyter_server_fileid>=0.7.0,<1",
"jsonschema>=4.18.0"
Expand Down

0 comments on commit f284083

Please sign in to comment.