benderjs / browser-launcher2

☠ This package is no longer maintained ☠
Other
24 stars 13 forks source link

Race condition can cause version to be empty string #51

Closed mitchhentges closed 8 years ago

mitchhentges commented 8 years ago

See detect.js. Upon process exit, it assumes that all stdout data has been read and calls the relevant callback. However, it should be on process close, because the stdout buffer has not been flushed yet at process exit

mitchhentges commented 8 years ago

For confirmation, see https://github.com/nodejs/node/wiki/API-changes-between-v0.6-and-v0.8.

the 'exit' event is now emitted right after the child process exits. It no longer waits for all stdio pipes to be closed. the 'close' event was added that has is emitted after the child has exited and all the stdio pipes are closed.

mitchhentges commented 8 years ago

Fixing it here: https://github.com/james-proxy/james-browser-launcher/pull/2