Automattic / Automattic/browser-repl

Double prompt

Open
#26 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Been hitting this situation recently:
![image](https://cloud.githubusercontent.com/assets/39191/7443713/7ac12f52-f115-11e4-9f08-173e47a03421.png)

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.