Skip to content

Commit 5f1ff45

Browse files
committed
Return a live copy
1 parent 7e71455 commit 5f1ff45

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

jupyter_collaboration/app.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,7 @@ async def get_document(
146146
return None
147147

148148
if isinstance(room, DocumentRoom):
149-
update = room.ydoc.get_update()
150-
151-
fork_ydoc = Doc()
152-
fork_ydoc.apply_update(update)
153-
154-
return YDOCS.get(content_type, YDOCS["file"])(fork_ydoc)
149+
return room._document
155150

156151
return None
157152

tests/test_app.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,3 @@ async def test_get_document_file(rtc_create_file, jp_serverapp):
6767
document = await collaboration.get_document(path=path, content_type="file", file_format="text")
6868
assert document.get() == content == "test"
6969
await collaboration.stop_extension()
70-
71-
72-
async def test_get_document_file_is_a_fork(rtc_create_file, jp_serverapp, rtc_fetch_session):
73-
path, content = await rtc_create_file("test.txt", "test", store=True)
74-
collaboration = jp_serverapp.web_app.settings["jupyter_collaboration"]
75-
document = await collaboration.get_document(path=path, content_type="file", file_format="text")
76-
document.set("other")
77-
fresh_copy = await collaboration.get_document(
78-
path=path, content_type="file", file_format="text"
79-
)
80-
assert fresh_copy.get() == "test"
81-
await collaboration.stop_extension()

0 commit comments

Comments
 (0)