wechaty-puppet-padplus icon indicating copy to clipboard operation
wechaty-puppet-padplus copied to clipboard

` room.say()` 得不到正确的消息是否交付成功的结果

Open KAWATAAAAAA opened this issue 2 years ago • 4 comments

1. Versions

  • What is your wechaty version? Answer: "@juzi/wechaty": "1.0.47"

  • What is your wechaty-puppet-padplus version? Answer: "@juzi/wechaty-puppet-padplus": "1.2.4",

  • What is your node version? (run node --version) Answer: v16.17.0

  • What os are you using Answer: Mac Os

2. Describe the bug

当我使用 await room.say() 的时候,即使群不存在,或者机器人不在群中,say方法返回的Promise依然是 Promise

这使得我无法得到消息是否正确交付的状态 image

3. To Reproduce

  1. 利用 bug https://github.com/wechaty/wechaty-puppet-padplus/issues/325 ,创造一个 room.has() 返回false 的群
  2. 向该群中发任意消息
  3. 所有say的promise 都是 fulfilled

4. Expected behavior

Promise应当为 ==> rejected

5. Actual behavior

Promise依然是 Promise

6. Full Output Logs

请关注日志关键词areyousure 输出

Show Logs
开始推送 1511635223 2023-03-27 17:52:01
17:52:01 SILL Room find({"id":"49169751155@chatroom"})
17:52:01 SILL Room ready()
17:52:01 SILL PuppetLoginMixin get currentUserId()
17:52:01 SILL PuppetPadplus roomMemberList(49169751155@chatroom)
[2023-03-27T17:52:01.126+08:00] [INFO] [85279] [] [wuyuweideMacBook-Pro.local] [172.21.144.49] [wechaty-robot] [] [] [] [] [8ms , requestInfo:{"method":"POST","url":"/robot/pushTask","host":"127.0.0.1:3000"}] ## '' 

areyousure false
17:52:01 VERB Room say(FileBox#Url<1817638618.png>, )
17:52:01 SILL PuppetPadplus messageSendFile(49169751155@chatroom)

17:52:01 SILL PuppetPadplus file url : https://front-xps-cdn.xsyx.xyz/custom/day360/2023/03/23/1817638618.png
17:52:01 SILL PuppetPadplus fileType image/png
17:52:01 SILL PuppetLoginMixin get currentUserId()
17:52:01 VERB PadplusManager sendFile()
17:52:01 VERB PadplusMessage sendFile()
17:52:01 SILL RequestClient request()
17:52:01 SILL DedupeApi dedupe() no need to dedupe api SEND_FILE.
17:52:01 SILL GRPC_GATEWAY GRPC Request ApiType: SEND_FILE
17:52:02 SILL GRPC_GATEWAY throttleQueue emit heartbeat.
17:52:02 VERB Watchdog <Puppet> feed({"data":"0e55078f-0ea6-4732-b93e-b231ef166bb8"})
17:52:02 VERB Watchdog <Puppet> timerLeft() = 44926
17:52:02 VERB Watchdog <Puppet> stopTimer()
17:52:02 VERB Watchdog <Puppet> startTimer()
17:52:02 SILL PadplusManager setContactAndRoomData()
17:52:02 VERB Message find({"id":"1679910722228"})
17:52:02 VERB Message findAll({"id":"1679910722228"})
17:52:02 VERB PuppetMessageMixin messageSearch({"id":"1679910722228"})
17:52:02 VERB PuppetMessageMixin messagePayload(1679910722228)
17:52:02 SILL PuppetMessageMixin messagePayloadCache(1679910722228) cache MISS
17:52:02 SILL PuppetPadplus messageRawPayload(1679910722228)
17:52:02 ERR PuppetPadplus messageRawPayload(1679910722228) manager.cacheManager.getMessage(1679910722228) return nothing.
17:52:02 VERB PuppetMessageMixin messageSearch() payload not found for id "1679910722228"

17:52:02 SILL PadplusManager setContactAndRoomData() found contact, room, friend data no change.
17:52:03 SILL Room find({"id":"49169751155@chatroom"})
17:52:03 SILL Room ready()
17:52:03 SILL PuppetLoginMixin get currentUserId()
17:52:03 SILL PuppetPadplus roomMemberList(49169751155@chatroom)
areyousure false
17:52:03 VERB Room say(FileBox#Url<410967943.jpg>, )
17:52:03 SILL PuppetPadplus messageSendFile(49169751155@chatroom)
17:52:03 SILL PuppetPadplus file url : https://front-xps-cdn.xsyx.xyz/custom/day360/2023/03/23/410967943.jpg
17:52:03 SILL PuppetPadplus fileType image/jpeg
17:52:03 SILL PuppetLoginMixin get currentUserId()
17:52:03 VERB PadplusManager sendFile()
17:52:03 VERB PadplusMessage sendFile()
17:52:03 SILL RequestClient request()
17:52:03 SILL DedupeApi dedupe() no need to dedupe api SEND_FILE.
17:52:03 SILL GRPC_GATEWAY GRPC Request ApiType: SEND_FILE
17:52:04 VERB Message find({"id":"1679910724316"})
17:52:04 VERB Message findAll({"id":"1679910724316"})
17:52:04 VERB PuppetMessageMixin messageSearch({"id":"1679910724316"})
17:52:04 VERB PuppetMessageMixin messagePayload(1679910724316)
17:52:04 SILL PuppetMessageMixin messagePayloadCache(1679910724316) cache MISS
17:52:04 SILL PuppetPadplus messageRawPayload(1679910724316)
17:52:04 ERR PuppetPadplus messageRawPayload(1679910724316) manager.cacheManager.getMessage(1679910724316) return nothing.
17:52:04 VERB PuppetMessageMixin messageSearch() payload not found for id "1679910724316"

17:52:05 VERB PadplusMessage sendMessage()
17:52:05 SILL RequestClient request()
17:52:05 SILL DedupeApi dedupe() no need to dedupe api SEND_MESSAGE.
17:52:05 SILL GRPC_GATEWAY GRPC Request ApiType: SEND_MESSAGE
17:52:05 VERB Message find({"id":"1679910725761"})
17:52:05 VERB Message findAll({"id":"1679910725761"})
17:52:05 VERB PuppetMessageMixin messageSearch({"id":"1679910725761"})
17:52:05 VERB PuppetMessageMixin messagePayload(1679910725761)
17:52:05 SILL PuppetMessageMixin messagePayloadCache(1679910725761) cache MISS
17:52:05 SILL PuppetPadplus messageRawPayload(1679910725761)
17:52:05 ERR PuppetPadplus messageRawPayload(1679910725761) manager.cacheManager.getMessage(1679910725761) return nothing.
17:52:05 VERB PuppetMessageMixin messageSearch() payload not found for id "1679910725761"

17:52:06 SILL Room find({"id":"49169751155@chatroom"})
17:52:06 SILL Room ready()
17:52:06 SILL PuppetLoginMixin get currentUserId()
17:52:06 SILL PuppetPadplus roomMemberList(49169751155@chatroom)
areyousure false
17:52:06 VERB MiniProgram constructor()
17:52:06 VERB Room say([object Object], )
17:52:06 SILL PuppetPadplus messageSendMiniProgram(49169751155@chatroom, [object Object])
17:52:06 SILL PuppetLoginMixin get currentUserId()
17:52:06 SILL PadplusManager sendMiniProgram(wxid_00j4zrd47usu12, 49169751155@chatroom, 
17:52:06 VERB PadplusMessage sendMessage()
17:52:06 SILL RequestClient request()
17:52:06 SILL DedupeApi dedupe() no need to dedupe api SEND_MESSAGE.
17:52:06 SILL GRPC_GATEWAY GRPC Request ApiType: SEND_MESSAGE
17:52:06 VERB Message find({"id":"1679910726779"})
17:52:06 VERB Message findAll({"id":"1679910726779"})
17:52:06 VERB PuppetMessageMixin messageSearch({"id":"1679910726779"})
17:52:06 VERB PuppetMessageMixin messagePayload(1679910726779)
17:52:06 SILL PuppetMessageMixin messagePayloadCache(1679910726779) cache MISS
17:52:06 SILL PuppetPadplus messageRawPayload(1679910726779)
17:52:06 ERR PuppetPadplus messageRawPayload(1679910726779) manager.cacheManager.getMessage(1679910726779) return nothing.
17:52:06 VERB PuppetMessageMixin messageSearch() payload not found for id "1679910726779"

完成推送 1511635223 2023-03-27 17:52:07
队列清空 wxid_00j4zrd47usu12



7. Additional context

KAWATAAAAAA avatar Mar 27 '23 09:03 KAWATAAAAAA

1. Versions

  • What is your wechaty version? Answer: "@juzi/wechaty": "1.0.47"
  • What is your wechaty-puppet-padplus version? Answer: "@juzi/wechaty-puppet-padplus": "1.2.4",
  • What is your node version? (run node --version) Answer: v16.17.0
  • What os are you using Answer: Mac Os

2. Describe the bug

当我使用 await room.say() 的时候,即使群不存在,或者机器人不在群中,say方法返回的Promise依然是 Promise,

这使得我无法得到消息是否正确交付的状态

3. To Reproduce

4. Expected behavior

Promise应当为 ==> rejected

5. Actual behavior

Promise依然是 Promise,

6. Full Output Logs

请关注日志关键词areyousure 输出

Show Logs

7. Additional context

如何创造一个不存在的群,或者说如何获取到一个bot不在群中的群,参考bug: #325

KAWATAAAAAA avatar Mar 27 '23 09:03 KAWATAAAAAA

底层无法检测群聊ID是否正确或者该群聊是否存在,只能通过超时来判断。

解决这个问题主要还是得通过 room.has(bot) 这个方法来判断。

su-chang avatar Mar 28 '23 14:03 su-chang

那么这个问题是不是只要等待room.has() 方法的bug修复了,就能解决了

KAWATAAAAAA avatar Apr 01 '23 01:04 KAWATAAAAAA

是的发自我的 iPhone在 2023年4月1日,09:11,KAWATAAAAAA @.***> 写道:

那么这个问题是不是只要等待room.has() 方法的bug修复了,就能解决了

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

su-chang avatar Apr 01 '23 03:04 su-chang