-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
PuppetWeb loses event listeners when resetting #1470
Comments
It works well after I remove |
Hello @hkusb! Thanks for reporting this. I had just checked the source code and I believe this bug had been removed for the latest version of Wechaty/PuppetPuppeteer. Could you please try with the Wechaty v0.18 or above version? Please let me know the result, and if the problem still exists, please file an issue at the PuppetPuppeteer Repository at https://github.com/Chatie/wechaty-puppet-puppeteer because it had been moved to its new home! BTW: I should warn you before you get started is that there has many BREAKING CHANGES between the v0.14 and v0.16. You can get more information from the release notes at https://github.com/Chatie/wechaty/releases/tag/v0.16.0 and our blog at https://blog.chatie.io/migrating-wechaty-v0.14-to-v0.18-guide-from-puppeteer-to-padchat-en/ |
Update: For your convenience, I had removed the Please feel free to let me know if there have any other problems with it. |
@hkusb Could you please confirm that whether this issue is resolved by my modification? |
Sorry, I've just seen it. It works very well for me. And I'm sorry for that I have no time to try it on v0.18 recently. I'll try it later. |
Thank you for the confirmation. I'll close this issue and please file a new issue if there's any problem with the version v0.18 or above. |
Why
setImmediate
needed when removing listeners of the bridge inPuppetWeb.quit()
. It seems a bug when resetting puppet. It causes the bridge to lose some event listeners likelogout
.Wechaty version: 0.14.4
When puppet's watchdog receives
reset
,pupput.quit()
andpuppet.init()
will be called. But there issetImmediate(() => this.bridge.removeAllListeners())
inquit()
. It meansthis.bridge.removeAllListeners()
will be called afterpuppet.init()
called. That is, it will remove the new bridge's listeners.Steps to reproduce
PuppetWeb will receive
reset
and chrome will recover after one minute. And then you won't receivelogout
andmessage
any more.The text was updated successfully, but these errors were encountered: