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

Notebook does not respond to key-presses after waking from sleep #1015

Closed
simonmcconnell opened this issue Feb 21, 2022 · 4 comments · Fixed by #1018
Closed

Notebook does not respond to key-presses after waking from sleep #1015

simonmcconnell opened this issue Feb 21, 2022 · 4 comments · Fixed by #1018

Comments

@simonmcconnell
Copy link
Contributor

Environment

  • Elixir & Erlang/OTP versions (elixir --version): 1.13.3, Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit] [win32]
  • Operating system: Windows 11
  • How have you started Livebook (mix phx.server, livebook CLI, Docker, etc): livebook server
  • Livebook version (use git rev-parse HEAD if running with mix): 0.5.2
  • Browsers that reproduce this bug (the more the merrier): Edge
  • Include what is logged in the browser console:
Uncaught Error: Unexpected server acknowledgement.
    at e.value (app.js:2:2884292)
    at e.value (app.js:2:2883250)
    at e._onAcknowledgement (app.js:2:2882800)
    at app.js:2:2891420
    at i (app.js:2:2847866)
    at Object.dispatchEvent (app.js:2:2825597)
    at If.constructor.dispatchEvent (app.js:2:3392280)
    at app.js:2:3392358
    at Array.forEach (<anonymous>)
    at If.constructor.dispatchEvents (app.js:2:3392335)
  • Include what is logged to the server console:

Current behavior

Start app with iex.bat --sname myname --cookie mycookie -S mix phx.server
Start livebook with livebook server
Connect to node (same thing happens with Elixir Standalone though)
Create a notebook, type some stuff, save it.
Put computer to sleep.
Wake computer.
(I think you have to reconnect to the node at this point)
Type in notebook -> typing does nothing, autosave still triggers. Above error seen in browser console. Can create new sections, but can't type in them.

If I close and then open the notebook, I see all the random stuff I was typing in the notebook.

Expected behavior

Things I type would appear in the notebook.

@josevalim
Copy link
Contributor

Thank you @simonmcconnell! Can you please check if this issue happens in other browsers? Also, for how long does Livebook sleep? Is it a matter of a few seconds or close to a minute or more?

@simonmcconnell
Copy link
Contributor Author

Initially I had the laptop closed overnight, but if I sleep and wake it up straight away it does it.

Firefox seems fine. Chrome has same issue. Do you want me to try Opera, Brave, Vivaldi...?

@josevalim
Copy link
Contributor

@simonmcconnell Firefox and Chrome is enough, thank you!

@jonatanklosko
Copy link
Member

The problem is that we don't handle reconnection properly, this can be reproduced with liveSocket.disconnect() followed by liveSocket.connect().

Apparently, Firefox keeps the connection on Windows hibernation, while Chrome/Edge don't, thanks @wojtekmach for helping to debug this!

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.

3 participants