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

[Bug]: 关于在“安卓端”的“私聊”窗口中,“回复”机器人的消息,生成的cq码中的id,get_msg报错“leveldb: not found”。 #2226

Closed
4 tasks done
Rootive opened this issue Jun 20, 2023 · 2 comments
Labels
bug? The issue author think this is a bug

Comments

@Rootive
Copy link

Rootive commented Jun 20, 2023

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述教程和 "提问前需知"
  • 我已经使用 dev分支版本 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(这些问题应当在 Discussion 板块提出。)

go-cqhttp 版本

1.0.1

运行环境

Linux

运行架构

AMD64

连接方式

HTTP

使用协议

1 | Android Phone
补充,我是用的协议实际上是在issue里找的一个json文件。我不太确定这会不会是影响因素。

重现步骤

我在此先道个歉:我并没有尝试将复现步骤缩小到最少,但是我承诺我这么做确实会导致意料外的情况:
两个角色,一个机器人,一个真人,以下都是“私聊”:
1.真人向机器人发送一则消息,内容任意,记为消息A;
2.机器人“回复”消息A,内容任意,记为消息B;
3.真人从“安卓端”“回复”消息B,内容任意,记为消息C;

机器人收到的消息C中,有reply消息B的cq码,该cq码中的id应是message_id,指向消息B,用此id通过get_msg API获取消息B。
注意1:我的“安卓端”展开讲是“QQ 体验模式”。此处说QQ是为了强调并非TIM;体验模式是指“设置-通用-模式选择”,并未测试“体验模式”是否会影响结果。
注意2:“回复”特指:长按消息后的“回复”选项。

期望的结果是什么?

成功通过消息C中的cq码获取消息B的内容。

实际的结果是什么?

报错:get value error: leveldb: not found。

简单的复现代码/链接(可选)

No response

日志记录(可选)

[2023-06-20 23:16:28] [DEBUG]: Protocol -> rev pkt: MessageSvc.PushNotify seq: -1462469490 
[2023-06-20 23:16:28] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbGetMsg seq: 13929 
[2023-06-20 23:16:28] [INFO]: 收到好友 呜呼噫嘻(真人QQ号) 的消息: 你好? (-747863209) 
[2023-06-20 23:16:28] [DEBUG]: 上报Event数据 {"post_type":"message","message_type":"private","time":1687274188,"self_id":机器人QQ号,"sub_type":"friend","message_id":-747863209,"user_id":真人QQ号,"target_id":机器人QQ号,"message":"你好?","raw_message":"你好?","font":0,"sender":{"age":0,"nickname":"呜呼噫嘻","sex":"unknown","user_id":真人QQ号}}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:28] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274188,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":64,"packet_sent":55,"packet_lost":0,"message_received":2,"message_sent":1,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:28] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbDeleteMsg seq: 13930 
[2023-06-20 23:16:29] [DEBUG]: Protocol -> rev pkt: Heartbeat.Alive seq: 13931 
[2023-06-20 23:16:29] [DEBUG]: HTTPServer接收到API调用: send_msg 
[2023-06-20 23:16:29] [INFO]: 发送好友 真人QQ号(真人QQ号)  的消息: [CQ:reply, ... (677305254) 
[2023-06-20 23:16:29] [INFO]: 收到好友 莫古力(机器人QQ号) 的消息: [CQ:reply,id=-353441334]您好有什么可以帮助您的吗? (677305254) 
[2023-06-20 23:16:29] [DEBUG]: 上报Event数据 {"post_type":"message_sent","message_type":"private","time":1687274189,"self_id":机器人QQ号,"sub_type":"friend","raw_message":"[CQ:reply,id=-353441334]您好!有什么可以帮助您的吗?","font":0,"sender":{"age":0,"nickname":"莫古力","sex":"unknown","user_id":机器人QQ号},"message_id":677305254,"user_id":机器人QQ号,"target_id":真人QQ号,"message":"[CQ:reply,id=-353441334]您好!有什么可以帮助您的吗?"}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:29] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbSendMsg seq: 13932 
[2023-06-20 23:16:33] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274193,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":67,"packet_sent":57,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:38] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274198,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":67,"packet_sent":57,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:43] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274203,"self_id":机器人QQ号,"interval":5000,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":67,"packet_sent":57,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}}}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:48] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274208,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":67,"packet_sent":57,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:53] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274213,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":67,"packet_sent":57,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:58] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274218,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":67,"packet_sent":57,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:16:59] [DEBUG]: Protocol -> rev pkt: Heartbeat.Alive seq: 13933 
[2023-06-20 23:17:03] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274223,"self_id":机器人QQ号,"interval":5000,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":68,"packet_sent":58,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}}}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:08] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274228,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":68,"packet_sent":58,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:13] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274233,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":68,"packet_sent":58,"packet_lost":0,"message_received":2,"message_sent":2,"disconnect_times":0,"lost_times":0,"last_message_time":1687274188}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:14] [DEBUG]: Protocol -> rev pkt: MessageSvc.PushNotify seq: -1461459676 
[2023-06-20 23:17:14] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbGetMsg seq: 13934 
[2023-06-20 23:17:14] [INFO]: 收到好友 呜呼噫嘻(真人QQ号) 的消息: [CQ:reply,id=677305254] 翻译成英文。 (26747859) 
[2023-06-20 23:17:14] [DEBUG]: HTTPServer接收到API调用: get_msg 
[2023-06-20 23:17:14] [DEBUG]: 上报Event数据 {"post_type":"message","message_type":"private","time":1687274234,"self_id":机器人QQ号,"sub_type":"friend","font":0,"sender":{"age":0,"nickname":"呜呼噫嘻","sex":"unknown","user_id":真人QQ号},"message_id":26747859,"user_id":真人QQ号,"target_id":机器人QQ号,"message":"[CQ:reply,id=677305254] 翻译成英文。","raw_message":"[CQ:reply,id=677305254] 翻译成英文。"}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:14] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbDeleteMsg seq: 13935 
[2023-06-20 23:17:15] [DEBUG]: HTTPServer接收到API调用: send_msg 
[2023-06-20 23:17:15] [INFO]: 发送好友 真人QQ号(真人QQ号)  的消息: [CQ:reply, ... (-1237692923) 
[2023-06-20 23:17:15] [INFO]: 收到好友 莫古力(机器人QQ号) 的消息: [CQ:reply,id=-1893773760]Hello! How can I assist you? (-1237692923) 
[2023-06-20 23:17:15] [DEBUG]: 上报Event数据 {"post_type":"message_sent","message_type":"private","time":1687274235,"self_id":机器人QQ号,"sub_type":"friend","target_id":真人QQ号,"message":"[CQ:reply,id=-1893773760]Hello! How can I assist you?","raw_message":"[CQ:reply,id=-1893773760]Hello! How can I assist you?","font":0,"sender":{"age":0,"nickname":"莫古力","sex":"unknown","user_id":机器人QQ号},"message_id":-1237692923,"user_id":机器人QQ号}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:15] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbSendMsg seq: 13936 
[2023-06-20 23:17:18] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274238,"self_id":机器人QQ号,"interval":5000,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":72,"packet_sent":61,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}}}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:23] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274243,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":72,"packet_sent":61,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:28] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274248,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":72,"packet_sent":61,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:29] [DEBUG]: Protocol -> rev pkt: Heartbeat.Alive seq: 13937 
[2023-06-20 23:17:33] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274253,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":73,"packet_sent":62,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:38] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274258,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":73,"packet_sent":62,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:43] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274263,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":73,"packet_sent":62,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:48] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274268,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":73,"packet_sent":62,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:53] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274273,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":73,"packet_sent":62,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:58] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274278,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":73,"packet_sent":62,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:17:59] [DEBUG]: Protocol -> rev pkt: Heartbeat.Alive seq: 13938 
[2023-06-20 23:18:03] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274283,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":74,"packet_sent":63,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:18:08] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274288,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":74,"packet_sent":63,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:18:13] [DEBUG]: 上报Event数据 {"post_type":"meta_event","meta_event_type":"heartbeat","time":1687274293,"self_id":机器人QQ号,"status":{"app_enabled":true,"app_good":true,"app_initialized":true,"good":true,"online":true,"plugins_good":null,"stat":{"packet_received":74,"packet_sent":63,"packet_lost":0,"message_received":3,"message_sent":3,"disconnect_times":0,"lost_times":0,"last_message_time":1687274234}},"interval":5000}
  http://127.0.0.1:5701/ 
[2023-06-20 23:18:13] [DEBUG]: Protocol -> rev pkt: MessageSvc.PushNotify seq: -1460594509 
[2023-06-20 23:18:13] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbGetMsg seq: 13939 
[2023-06-20 23:18:13] [INFO]: 收到好友 呜呼噫嘻(真人QQ号) 的消息: [CQ:reply,id=-1495681483]再次翻译成英文。 (-1860151858) 
[2023-06-20 23:18:13] [DEBUG]: 上报Event数据 {"post_type":"message","message_type":"private","time":1687274293,"self_id":机器人QQ号,"sub_type":"friend","message_id":-1860151858,"user_id":真人QQ号,"target_id":机器人QQ号,"message":"[CQ:reply,id=-1495681483]再次翻译成英文。","raw_message":"[CQ:reply,id=-1495681483]再次翻译成英文。","font":0,"sender":{"age":0,"nickname":"呜呼噫嘻","sex":"unknown","user_id":真人QQ号}}
  http://127.0.0.1:5701/ 
[2023-06-20 23:18:13] [DEBUG]: HTTPServer接收到API调用: get_msg 
[2023-06-20 23:18:13] [WARNING]: 获取消息时出现错误: get value error: leveldb: not found 
[2023-06-20 23:18:13] [DEBUG]: HTTPServer接收到API调用: send_msg 
[2023-06-20 23:18:13] [INFO]: 发送好友 真人QQ号(真人QQ号)  的消息: [CQ:reply, ... (-1052934509) 
[2023-06-20 23:18:13] [INFO]: 收到好友 莫古力(机器人QQ号) 的消息: [CQ:reply,id=531052637](获取引用未完成) (-1052934509) 
[2023-06-20 23:18:13] [DEBUG]: 上报Event数据 {"post_type":"message_sent","message_type":"private","time":1687274293,"self_id":机器人QQ号,"sub_type":"friend","sender":{"age":0,"nickname":"莫古力","sex":"unknown","user_id":机器人QQ号},"message_id":-1052934509,"user_id":机器人QQ号,"target_id":真人QQ号,"message":"[CQ:reply,id=531052637](获取引用未完成)","raw_message":"[CQ:reply,id=531052637](获取引用未完成)","font":0}
  http://127.0.0.1:5701/ 
[2023-06-20 23:18:13] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbDeleteMsg seq: 13940 
[2023-06-20 23:18:13] [DEBUG]: Protocol -> rev pkt: MessageSvc.PbSendMsg seq: 13941

补充说明(可选)

实测,如果全程在PC端操作,不会导致此问题。
实测,如果消息C回复的是真人发送的消息,也不会导致此问题。

@Rootive Rootive added the bug? The issue author think this is a bug label Jun 20, 2023
@xiangxiangxiong9
Copy link
Contributor

xiangxiangxiong9 commented Jun 21, 2023

已复现
Commit: 73610ec
奇怪的问题

@xiangxiangxiong9
Copy link
Contributor

xiangxiangxiong9 commented Jun 21, 2023

id := source.PrimaryID

此处应该用 r.Sender ?


220602 1030
不对...这样会导致群消息的replyID不对了

xiangxiangxiong9 added a commit to xiangxiangxiong9/go-cqhttp that referenced this issue Jun 21, 2023
xiangxiangxiong9 added a commit to xiangxiangxiong9/go-cqhttp that referenced this issue Jun 21, 2023
xiangxiangxiong9 added a commit to xiangxiangxiong9/go-cqhttp that referenced this issue Jun 22, 2023
@fumiama fumiama closed this as completed in 2b1d9c2 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? The issue author think this is a bug
Projects
None yet
Development

No branches or pull requests

2 participants