Wang-Decheng / ChatApp

3 stars 2 forks source link

离线消息功能测试 #26

Open Tang-Chenhang opened 6 months ago

Tang-Chenhang commented 6 months ago

测试离线消息时,首先登录user1向user2发送消息,此时user2不在线。当user2上线时无法收到来自server的离线消息 image image

Wang-Decheng commented 6 months ago

image 看来是发送了,不过存在时序问题,我去加个sleep

Tang-Chenhang commented 6 months ago

image 看来是发送了,不过存在时序问题,我去加个sleep

可以在离线用户上线后,请求好友状态后发送

Wang-Decheng commented 6 months ago

感觉不太符合逻辑

Wang-Decheng commented 6 months ago

https://github.com/Wang-Decheng/ChatApp/commit/faed9536baaee25187324ba10239dccd3f28f0df 修改已经提交

Tang-Chenhang commented 6 months ago

加入sleep代码后,登录时首先f发送离线消息,之后user2确认登录。且此时若请求获取好友状态,则没有response响应报文,出现json解析错误 image

Wang-Decheng commented 6 months ago

哦我知道了,sleep阻塞了,估计得加线程,你先回退一下吧,我过会解决一下,现在有其他事情; 可以先试试文件传输的部分正常不