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

登录后收到退出登录的事件(怀疑是chromium浏览器跳转或被关闭了,暂不清楚原因) #105

Closed
Tracked by #19
su-chang opened this issue Jan 27, 2022 · 5 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@su-chang
Copy link
Member

su-chang commented Jan 27, 2022

问题描述

扫码登录后,紧接着会收到一个退出登录的事件,程序终止(这个和 #101 有关),导致无法正常使用。

日志

下面列出了异常退出登录和正常退出登录两种情况的日志。

# 异常登出

12:02:17 INFO PuppetWhatsApp event: "disconnected", value: "NAVIGATION"
12:02:17 INFO PuppetWhatsApp onLogout(已退出登录)
12:02:17 VERB MemoryCard <> delete(PUPPET_WHATSAPP)
12:02:17 VERB MemoryCard <session-file> save() to StorageFile</Users/suchang/Desktop/PROJECT/company-project/wechaty-related-project/puppet-whatsapp/session-file.memory-card.json>
12:02:17 VERB StorageFile save() to /Users/suchang/Desktop/PROJECT/company-project/wechaty-related-project/puppet-whatsapp/session-file.memory-card.json
12:02:17 INFO PuppetWhatsApp onLogout(8613126768525@c.us, 已退出登录)
12:02:17 INFO PuppetWhatsApp LOGOUT, 8613126768525@c.us
8613126768525@c.us logouted


# 正常登出

12:05:13 INFO PuppetWhatsApp event: "disconnected", value: "NAVIGATION"
12:05:13 INFO PuppetWhatsApp onLogout(已退出登录)
12:05:13 VERB MemoryCard <> delete(PUPPET_WHATSAPP)
12:05:13 VERB MemoryCard <session-file> save() to StorageFile</Users/suchang/Desktop/PROJECT/company-project/wechaty-related-project/puppet-whatsapp/session-file.memory-card.json>
12:05:13 VERB StorageFile save() to /Users/suchang/Desktop/PROJECT/company-project/wechaty-related-project/puppet-whatsapp/session-file.memory-card.json
12:05:13 INFO PuppetWhatsApp onLogout(8613126768525@c.us, 已退出登录)
12:05:13 INFO PuppetWhatsApp LOGOUT, 8613126768525@c.us
8613126768525@c.us logouted
@su-chang su-chang mentioned this issue Jan 27, 2022
42 tasks
@su-chang
Copy link
Member Author

Related issue: #82

@su-chang
Copy link
Member Author

目前在海外服务器尚未复现该问题,需要持续关注。

@su-chang su-chang added the help wanted Extra attention is needed label Jan 28, 2022
@bung87
Copy link
Contributor

bung87 commented Jan 29, 2022

related: #101 (comment)

whatsapp-web disconnected event emit -> client.destory -> puppet on logout.

reason: puppet use stored session which is invalid , whatsapp redirect to current location trying to get fresh new qrcode while whatsapp-web detected redirect so emit disconnected event.

@huan
Copy link
Member

huan commented Jan 29, 2022

Thank you very much for linking them together

@kellyiscute kellyiscute self-assigned this Feb 8, 2022
@kellyiscute
Copy link
Collaborator

whatsapp-web.js listens to puppeteer event framenavigated and when this event is fired, it kills the browser because the author was assuming that once the browser reloads or navigated, it is a logout event and kills the browser. However, whatsApp refreshes the page after login, which triggers the framenavigated event. Strangely, when puppeteer not under headless mode, this event does not fire.
This bug is resolved in the repository juzibot/whatsapp-web.js.
Therefore closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants