wechaty/puppet-whatsapp

掉线的时候消息丢失,不可控

Open

#208 opened on 2022年2月15日

GitHub で見る
 (4 comments) (0 reactions) (1 assignee)TypeScript (23 forks)github user discovery
discusshelp wanted

Repository metrics

Stars
 (26 stars)
PR merge metrics
 (PR metrics pending)

説明

测试结果文档链接(待补充):https://k0auuqcihb.feishu.cn/wiki/wikcnVwzIb24hmiW6upptq6Sfsw

解决方案

目前观察发现 WhatsApp Web 端在手机离线的情况下接收到的消息都会同步成功。

whatsapp-web.js 的 SDK 中提供接口 fetchMessage(),参见:https://docs.wwebjs.dev/Chat.html#fetchMessages

考虑在 puppet-whatsapp 中触发 READY 事件前,针对当前所有会话拉取近期的消息:

  • 该消息已经存在缓存中

    忽略该消息

  • 该消息不存在缓存中

    推送该消息至 Wechaty

コントリビューターガイド