Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-talk, warnings, and errors with multiple jupyterlab tabs #139

Closed
rdeits opened this issue Jun 6, 2018 · 0 comments · Fixed by #211
Closed

Cross-talk, warnings, and errors with multiple jupyterlab tabs #139

rdeits opened this issue Jun 6, 2018 · 0 comments · Fixed by #211

Comments

@rdeits
Copy link
Collaborator

rdeits commented Jun 6, 2018

Jupyterlab allows multiple notebooks to be opened simultaneously in the same browser tab by using its own internal jupyter tabs. That seems to play very badly with WebIO.jl. For example, try running the random_print_button() demo from the Readme in two different jupyterlab notebooks (living in jupyterlab tabs in the same browser tab):

function random_print_button()
    w = Scope()

    obs = Observable(w, "rand-value", 0.0)

    on(obs) do x
        println("JS sent $x")
    end

    w(
      dom"button"(
        "generate random",
        events=Dict("click"=>@js () -> $obs[] = Math.random()),
      ),
    )
end

random_print_button()

Running this code in both notebooks causes the first Julia kernel to receive the messages from both tabs, even though their scope IDs are different. The result is that the "JS sent $x" message is printed in the output of the first notebook even when you click buttons in the second notebook.

Running the cell a few more times eventually gets WebIO into a state where neither button does anything except throw "invalid message received" warnings in the JS console and no output is printed at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant