Fix default chunks info

This commit is contained in:
Jonatan Kłosko 2022-11-17 19:53:57 +01:00
parent 16d473685a
commit c0fa414593
2 changed files with 3 additions and 3 deletions

View file

@ -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)}

View file

@ -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