Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Sep 4, 2024
1 parent 5d5900f commit de4ea5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/HTTPServer/browser-display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ function Base.display(display::BrowserDisplay, app::App)
if success
handler.session.status = Bonito.DISPLAYED
# if open_browser, we need to let the caller wait!
wait_for_ready(handler.session)
wait_for() do
session = handler.session # can change inbetween
if !isnothing(session.init_error[])
throw(session.init_error[])
end
return isready(session)
end
wait_for_ready(app)
end
end
Expand Down
3 changes: 0 additions & 3 deletions src/serialization/protocol.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ Handles the incoming websocket messages from the frontend.
Messages are expected to be gzip compressed and packed via MsgPack.
"""
function process_message(session::Session, bytes::AbstractVector{UInt8})
if session.threadid != Threads.threadid()
error("process_message should only be called from the same thread as the session")
end
if isempty(bytes)
@warn "empty message received from frontend"
return
Expand Down
3 changes: 0 additions & 3 deletions src/session.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ function wait_for_ready(session::Session; timeout=100)
return :success
end
session.status == CLOSED && return nothing
if session.status !== DISPLAYED
error("Session got not displayed yet, so waiting for it to become ready is futile. Status: $(session.status)")
end
return wait_for(timeout=timeout) do
if !isnothing(session.init_error[])
throw(session.init_error[])
Expand Down

0 comments on commit de4ea5e

Please sign in to comment.