trazyn / weweChat

💬 Unofficial WeChat client built with React, MobX and Electron.
MIT License
5.75k stars 735 forks source link

系统休眠后唤醒,程序接受不到聊天消息 #25

Closed flyfei closed 7 years ago

flyfei commented 7 years ago

synccheck 接口 status 200 response window.synccheck={retcode:"0",selector:"2"} 然后执行 webwxsync 接口 status canceled 没有数据返回

再然后就没synccheck/webwxsync接口请求了

trazyn commented 7 years ago

漏掉了这一条消息么?

flyfei commented 7 years ago

好像是,这是 网络请求记录 image

flyfei commented 7 years ago

能不能系统唤醒后,程序还能接收到新消息(先不考虑漏掉的消息)

trazyn commented 7 years ago

cancel 掉的是synccheck请求,这个只是用来获取状态的,比如是否有未读,是否有新的好友等。 webwxsync 是对上面的状态进行处理,只要你的消息还没被读取就能收到,webwxsync被执行的时候就能取到消息。

现在唤醒后是会继续进行心跳的,cancel掉synccheck是为了刷新synckey进行新的心跳避免僵尸请求和kill掉原来的僵尸请求,所以从你唤醒后就不会漏掉消息的

On August 31, 2017 at 1:03:54 AM, ToviZhao (notifications@github.com) wrote:

能不能系统唤醒后,程序还能接收到新消息(不考虑漏掉的消息)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

flyfei commented 7 years ago

OK。唤醒设备后,就停到这儿了,webwxsync canceled 状态 image

trazyn commented 7 years ago

刚看了下我这里是好的,我等下再打个包吧

On August 31, 2017 at 1:25:19 AM, ToviZhao (notifications@github.com) wrote:

OK。唤醒设备后,就停到这儿了,webwxsync canceled 状态

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

flyfei commented 7 years ago

@trazyn 嗯,可以让系统休眠的时间长些,唤醒后,再看看

trazyn commented 7 years ago

看你截图里面的hmr请求,你的应该是代码需要更新了,最新的包已经更新到release了

On August 31, 2017 at 1:31:14 AM, ToviZhao (notifications@github.com) wrote:

@trazyn 嗯,可以让系统休眠的时间长些,唤醒后,再看看

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

flyfei commented 7 years ago

更新后,到目前还没有复现。👍

flyfei commented 7 years ago

用的新的程序。唤醒后,收不到数据 image

flyfei commented 7 years ago

这样处理,看行不行 ?点击某个聊天的时候,会有网络请求(比方说webwxgeticon请求)。执行请求的时候,检测 synccheck/webwxsync 是否能用

trazyn commented 7 years ago

这样子垃圾请求感觉有点多,有洁癖不喜欢看到这种东西 目前超时掉线和用户登出还有系统唤醒都能检测出,剩下断网的检测没有

trazyn commented 7 years ago

添加离线检测