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

MemberHonorChangeEvent 事件会重复收到两次 #1707

Closed
djkcyl opened this issue Dec 2, 2021 · 3 comments
Closed

MemberHonorChangeEvent 事件会重复收到两次 #1707

djkcyl opened this issue Dec 2, 2021 · 3 comments
Labels
N 优先级: 一般 s:core 子系统: mirai-core t:bug 类型: bug x:protocol 属性: 协议相关
Milestone

Comments

@djkcyl
Copy link

djkcyl commented Dec 2, 2021

问题描述

RT·

复现

收到群荣誉变更的事件时

mirai-core 版本

2.9M1

bot-protocol

IPAD

其他组件版本

mah 233

系统日志

网络日志

补充信息

project-mirai/mirai-api-http#511

@djkcyl djkcyl added the x:question 标签: 需要更多信息 label Dec 2, 2021
@Karlatemp Karlatemp added N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题 labels Dec 2, 2021
@Him188 Him188 added this to the 2.9.0-RC milestone Dec 3, 2021
@Karlatemp
Copy link
Member

For mamoe:

+ 1st received
- 2nd received

 2021-12-05 15:43:24 D/Net 1111111111: Packet Handling Processor: receive packet Heartbeat.Alive
+2021-12-05 15:44:04 D/NetReplayHelper: sid=-764276282, cmd=OnlinePush.ReqPush, body=<DROPPED>
+2021-12-05 15:44:04 D/Net 1111111111: Packet Handling Processor: receive packet OnlinePush.ReqPush
-2021-12-05 15:44:04 D/NetReplayHelper: sid=-758493689, cmd=OnlinePush.ReqPush, body=<DROPPED>
-2021-12-05 15:44:04 D/Net 1111111111: Packet Handling Processor: receive packet OnlinePush.ReqPush
 2021-12-05 15:44:04 V/Bot 1111111111: Event: GroupTalkativeChangeEvent(group=, now=, previous=)
 2021-12-05 15:44:04 V/Bot 1111111111: Event: GroupTalkativeChangeEvent(group=, now=, previous=)
 2021-12-05 15:44:04 V/Bot 1111111111: Event: MemberHonorChangeEvent.Lose(member=, honorType=TALKATIVE)
 2021-12-05 15:44:04 V/Bot 1111111111: Event: MemberHonorChangeEvent.Lose(member=, honorType=TALKATIVE)
 2021-12-05 15:44:04 V/Bot 1111111111: Event: MemberHonorChangeEvent.Achieve(member=, honorType=TALKATIVE)
 2021-12-05 15:44:04 V/Bot 1111111111: Event: MemberHonorChangeEvent.Achieve(member=, honorType=TALKATIVE)


 2021-12-05 17:46:39 D/soutv: unnamed = SvcReqPushMsg#320304382 {
+           svrip=0x88CC870B(-1999862005)
-           svrip=0x8693870B(-2037151989)
            uMsgTime=0x0000000061AC6DC7(1638690247)
            uin=<DROPPED>
            vMsgInfos=[MsgInfo#926434463 {
                    lFromInstId=0x0000000000000000(0)
                    lFromUin=<DROPPED>
                    lLastChangeTime=0x0000000000000001(1)
                    lMsgUid=0x02000000025902DC(144115188115243740)
+                   shMsgSeq=0x8201(-32255)
+                   shMsgType=0x02DC(732)
-                   shMsgSeq=0x0F57(3927)
-                   shMsgType=0x02DC(732)
                    stShareData=ShareData#212683148 {
                    }
                    uAppShareID=0x0000000000000000(0)
                    uMsgTime=0x0000000000000000(0)
                    uRealMsgTime=0x61AC6DC7(1638690247)
                    vCPicInfo=[]
                    vMsg=<SAME VMSG>
                    vMsgCookies=<SAME VMSG COOKIES>
                    vNickName=[]
            }]
            vUinPairMsg=[]
    }

@Karlatemp Karlatemp added the x:protocol 属性: 协议相关 label Dec 5, 2021
@Him188 Him188 modified the milestones: 2.9.0-RC, 2.9.0, 2.8.4 Dec 10, 2021
@Him188
Copy link
Member

Him188 commented Dec 21, 2021

            // 龙王
            10093L, 1053L, 1054L -> {
                val now: NormalMember = grayTip.msgTemplParam["uin"]?.findMember() ?: group.botAsMember
                val previous: NormalMember? = grayTip.msgTemplParam["uin_last"]?.findMember()

                if (previous == null) {
                    collect(MemberHonorChangeEvent.Achieve(now, GroupHonorType.TALKATIVE))
                } else {
                    collect(GroupTalkativeChangeEvent(group, now, previous))
                    collect(MemberHonorChangeEvent.Lose(previous, GroupHonorType.TALKATIVE))
                    collect(MemberHonorChangeEvent.Achieve(now, GroupHonorType.TALKATIVE))
                }
            }

@Karlatemp 确定 log 顺序没有修改? 这里每次接收都 collect 一个事件, 那么广播也应该是按顺序广播完了再广播一个循环, 但 log 里是分别广播两次, 说明是同时处理的

msgUid 相同么? 看起来没有 seq 之类的能简单过滤重复的东西, 只能做 id 缓存了. 我也没法拿到能复现这个东西的数据...

@Him188 Him188 modified the milestones: 2.8.4, 2.10.0-RC Dec 21, 2021
@Him188 Him188 closed this as completed in 10af69f Dec 21, 2021
@Karlatemp
Copy link
Member

@Him188 unmodified

@Him188 Him188 added t:bug 类型: bug s:core 子系统: mirai-core and removed x:question 标签: 需要更多信息 t:problem 类型: 不容易归类为特性或 bug 的综合问题 labels Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N 优先级: 一般 s:core 子系统: mirai-core t:bug 类型: bug x:protocol 属性: 协议相关
Projects
None yet
Development

No branches or pull requests

3 participants