From c0fa41459379af20b2992653b85b96b63cfdcd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Thu, 17 Nov 2022 19:53:57 +0100 Subject: [PATCH] Fix default chunks info --- lib/livebook/session.ex | 4 ++-- test/livebook/session_test.exs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/livebook/session.ex b/lib/livebook/session.ex index 64a7928ca..0575211bc 100644 --- a/lib/livebook/session.ex +++ b/lib/livebook/session.ex @@ -1109,7 +1109,7 @@ defmodule Livebook.Session do case Notebook.fetch_cell_and_section(state.data.notebook, id) do {:ok, cell, _section} -> - chunks = info[:chunks] || [] + chunks = info[:chunks] delta = Livebook.JSInterop.diff(cell.source, info.source) operation = @@ -1130,7 +1130,7 @@ defmodule Livebook.Session do def handle_info({:runtime_smart_cell_update, id, attrs, source, info}, state) do case Notebook.fetch_cell_and_section(state.data.notebook, id) do {:ok, cell, _section} -> - chunks = info[:chunks] || [] + chunks = info[:chunks] delta = Livebook.JSInterop.diff(cell.source, source) operation = {:update_smart_cell, @client_id, id, attrs, delta, chunks, info.reevaluate} {:noreply, handle_operation(state, operation)} diff --git a/test/livebook/session_test.exs b/test/livebook/session_test.exs index 0b32e28e0..e801163fa 100644 --- a/test/livebook/session_test.exs +++ b/test/livebook/session_test.exs @@ -692,7 +692,7 @@ defmodule Livebook.SessionTest do delta = Delta.new() |> Delta.retain(7) |> Delta.insert("!") cell_id = smart_cell.id - assert_receive {:operation, {:smart_cell_started, _, ^cell_id, ^delta, [], %{}, nil}} + assert_receive {:operation, {:smart_cell_started, _, ^cell_id, ^delta, nil, %{}, nil}} end test "sends an event to the smart cell server when the editor source changes" do