Skip to content

Commit

Permalink
tweak, fix tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Jul 16, 2023
1 parent ac12f82 commit bda1770
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/evaluation/WorkspaceManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,7 @@ function start_relaying_logs((session, notebook)::SN, log_channel::Distributed.R
@assert !isnothing(display_cell)

# this handles the use of published_to_js inside logs: objects that were newly published during the rendering of the log args.
if !isempty(next_log["new_published_objects"])
display_cell.published_objects = merge(display_cell.published_objects, next_log["new_published_objects"])
end
merge!(display_cell.published_objects, next_log["new_published_objects"])
delete!(next_log, "new_published_objects")

push!(display_cell.logs, next_log)
Expand Down
2 changes: 1 addition & 1 deletion src/runner/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ end"""
const currently_running_cell_id = Ref{UUID}(uuid4())

function _publish(x, id_start, cell_id)::String
id = string(notebook_id[], "/", cell_id, "/", id_start)
id = "$(notebook_id[])/$cell_id/$id_start"
d = get!(Dict{String,Any}, cell_published_objects, cell_id)
d[id] = x
return id
Expand Down
8 changes: 5 additions & 3 deletions test/Dynamic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,19 @@ end
@testset "PlutoRunner API" begin
🍭 = ServerSession()
🍭.options.evaluation.workspace_use_distributed = true

cid = uuid1()

notebook = Notebook([
Cell("PlutoRunner.notebook_id[] |> Text"),
Cell("""
Cell(cid, """
let
# not actually public API but we test it anyways
a = PlutoRunner._publish(Dict(
"hello" => "world",
"xx" => UInt8[6,7,8],
))
b = PlutoRunner._publish("cool")
), "aaa", Base.UUID("$cid"))
b = PlutoRunner._publish("cool", "bbb", Base.UUID("$cid"))
Text((a, b))
end
"""),
Expand Down

0 comments on commit bda1770

Please sign in to comment.