From 7912409cf72c89ca3860543ada28335c51738c6c Mon Sep 17 00:00:00 2001 From: Carlos Herrero <26092748+hbcarlos@users.noreply.github.com> Date: Thu, 29 Jun 2023 18:55:55 +0200 Subject: [PATCH 1/3] Use fileId instead as path when storing the updates --- jupyter_collaboration/handlers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jupyter_collaboration/handlers.py b/jupyter_collaboration/handlers.py index 97bc3e8f..5bf3de6b 100644 --- a/jupyter_collaboration/handlers.py +++ b/jupyter_collaboration/handlers.py @@ -84,9 +84,8 @@ async def prepare(self): ) file = self._file_loaders[file_id] - path = self._file_id_manager.get_path(file_id) - path = Path(path) - updates_file_path = str(path.parent / f".{file_type}:{path.name}.y") + path = Path(self._file_id_manager.get_path(file_id)) + updates_file_path = str(path.parent / f".{file_type}:{file_id}.y") ystore = self._ystore_class(path=updates_file_path, log=self.log) self.room = DocumentRoom( self._room_id, From 2554ed7f235519cc57139e065c2c1b2561d6f522 Mon Sep 17 00:00:00 2001 From: Carlos Herrero <26092748+hbcarlos@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:34:13 +0200 Subject: [PATCH 2/3] Updates file name in the store --- jupyter_collaboration/handlers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jupyter_collaboration/handlers.py b/jupyter_collaboration/handlers.py index 5bf3de6b..264395d2 100644 --- a/jupyter_collaboration/handlers.py +++ b/jupyter_collaboration/handlers.py @@ -84,8 +84,7 @@ async def prepare(self): ) file = self._file_loaders[file_id] - path = Path(self._file_id_manager.get_path(file_id)) - updates_file_path = str(path.parent / f".{file_type}:{file_id}.y") + updates_file_path = f".{file_type}:{file_id}.y" ystore = self._ystore_class(path=updates_file_path, log=self.log) self.room = DocumentRoom( self._room_id, From b2a15decb26d48389ffac086cdca9eec42c7a2ef Mon Sep 17 00:00:00 2001 From: Carlos Herrero <26092748+hbcarlos@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:51:44 +0200 Subject: [PATCH 3/3] Run pre-commit --- jupyter_collaboration/handlers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/jupyter_collaboration/handlers.py b/jupyter_collaboration/handlers.py index 264395d2..d0166097 100644 --- a/jupyter_collaboration/handlers.py +++ b/jupyter_collaboration/handlers.py @@ -6,7 +6,6 @@ import asyncio import json import uuid -from pathlib import Path from typing import Any from jupyter_server.auth import authorized