diff --git a/src/HTTPServer/browser-display.jl b/src/HTTPServer/browser-display.jl index 57b323ab..8b9ac6fd 100644 --- a/src/HTTPServer/browser-display.jl +++ b/src/HTTPServer/browser-display.jl @@ -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 diff --git a/src/serialization/protocol.jl b/src/serialization/protocol.jl index 0205e073..d3307bbd 100644 --- a/src/serialization/protocol.jl +++ b/src/serialization/protocol.jl @@ -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 diff --git a/src/session.jl b/src/session.jl index 7c6f8640..98fcbd25 100644 --- a/src/session.jl +++ b/src/session.jl @@ -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[])