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

Version v0.15.2 and kill chrome instance #307

Closed
diegogmez opened this issue Jul 14, 2023 · 3 comments
Closed

Version v0.15.2 and kill chrome instance #307

diegogmez opened this issue Jul 14, 2023 · 3 comments

Comments

@diegogmez
Copy link

diegogmez commented Jul 14, 2023

Hello!,

We have recently migrated the library from version v0.15.1 to v0.15.2 and we have encountered a problem

In the kill method the instance of the chrome that it returns when executing in launch() behaves differently:

v0.15.1 returned a promise
v0.15.2 returns a void

image

image

The readme documentation still persists with a promise. Is it an error in the documentation? Was this change expected?

@connorjclark
Copy link
Collaborator

This was changed in #269

Killing a process is really just sending a signal, which is synchronous, and is why the original interface of returning a Promise was not ideal. See https://nodejs.org/api/process.html#processkillpid-signal

We should update our documentation. Thanks for catching this!

@connorjclark
Copy link
Collaborator

connorjclark commented Jul 14, 2023

BTW - it's important to note that if you are wanting to wait for confirmation that the process is gone, you'll have to listen to the child process's exit event: https://nodejs.org/api/child_process.html#event-exit

@diegogmez
Copy link
Author

Perfect!!

Now we are using exactly the approach that you are suggesting but since in the previous implementation there was this promise, we were relying on it!. And that is rights we need some feedback / confirmation / error handling to be ensure there is not hang chrome process there :)

The main problem was the mismatch Documentation - Code :) but we always trust on the code hahahah

We can close the thread

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

No branches or pull requests

2 participants