Double prompt
Been hitting this situation recently:

Two prompt()s are initiated, connected to the same client.
Not sure of the root cause, but we're getting two "connection" events inbound sometimes.
This may be a side-effect of the deps bumps I did. :/
Meanwhile, I've noticed that the vm.get callback sometimes starts much later than the socket's "connection" event. I moved start() into that callback in https://github.com/Automattic/browser-repl/commit/3b834cb80663106caa542b84be441cba70a3ffb6 but I think it's a race condition either way.
To me, feels like the fix to both is only starting the prompt once both wd and the socket are ready
Hows that sound?
Getting this as well. Really wonky
Here are the two locations:
- socket.io ready: https://github.com/Automattic/browser-repl/blob/448cf4ccf6c0c47b92ab75f4977840157c3c68ab/repl.js#L120
- wd ready: https://github.com/Automattic/browser-repl/blob/448cf4ccf6c0c47b92ab75f4977840157c3c68ab/repl.js#L110
AFAIK we just need some Promise.all() equivalent to kick off start() once those locations resolve. @rauchg do you have any different preference here?
no preference, makes sense to wait for both
K. If someone wants to add Bluebird and hook this up, the PR should be straightforward based on my last comment. I won't be able to get to it soon.