From 6274731c8daca1904c7d38649fa71ee9bec0d90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Thu, 10 Jun 2021 20:03:47 +0200 Subject: [PATCH] Make sure session is forked with complete data --- lib/livebook_web/live/session_live.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/livebook_web/live/session_live.ex b/lib/livebook_web/live/session_live.ex index 609ebacbb..a56e2a133 100644 --- a/lib/livebook_web/live/session_live.ex +++ b/lib/livebook_web/live/session_live.ex @@ -547,7 +547,9 @@ defmodule LivebookWeb.SessionLive do end def handle_event("fork_session", %{}, socket) do - notebook = Notebook.forked(socket.private.data.notebook) + # Fetch the data, as we don't keep cells' source in the state + data = Session.get_data(socket.assigns.session_id) + notebook = Notebook.forked(data.notebook) %{images_dir: images_dir} = Session.get_summary(socket.assigns.session_id) create_session(socket, notebook: notebook, copy_images_from: images_dir) end