Skip to content

Commit 651084b

Browse files
committed
Return a live copy
1 parent fc85cdb commit 651084b

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
@@ -158,12 +158,7 @@ async def get_document(
158158
return None
159159

160160
if isinstance(room, DocumentRoom):
161-
update = room.ydoc.get_update()
162-
163-
fork_ydoc = Doc()
164-
fork_ydoc.apply_update(update)
165-
166-
return YDOCS.get(content_type, YDOCS["file"])(fork_ydoc)
161+
return room._document
167162

168163
return None
169164

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)