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

save room join sys message to cache #1333

Merged
merged 1 commit into from
Jun 13, 2018
Merged

Conversation

lijiarui
Copy link
Member

@lijiarui lijiarui commented Jun 13, 2018

Sometimes rpc will get the same message twice:

23:07:00 VERB PuppetPadchat onPadchatMessage({id=6226126162641344476, type=Sys(5)})
rawPayload: { content: '你将"太阁_传话助手"移出了群聊',
  continue: 1,
  description: '',
  from_user: '6350854677@chatroom',
  msg_id: '6226126162641344476',
  msg_source: '',
  msg_type: 5,
  status: 1,
  sub_type: 10000,
  timestamp: 1528902420,
  to_user: 'wxid_zj2cahpwzgie12',
  uin: 324216852 }
23:07:00 VERB PuppetPadchat onPadchatMessageFriendshipEvent({id=6226126162641344476})
23:07:00 VERB PuppetPadchat onPadchatMessageRoomEvent({id=6226126162641344476})
23:07:00 VERB Puppet roomMemberSearch(6350854677@chatroom, "太阁_传话助手")
23:07:00 VERB Puppet roomMemberSearch(6350854677@chatroom, {"roomAlias":"太阁_传话助手"})
23:07:00 VERB PuppetPadchat roomMemberList(6350854677@chatroom)
23:07:00 VERB PuppetPadchatManager getRoomMemberIdList(6350854677)
23:07:00 VERB PuppetPadchatManager getRoomMemberIdList(6350854677) length=4
23:07:00 SILL PuppetPadchat roomMemberList()=4
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 SILL Puppet roomMemberPayloadCache(6350854677@chatroom) cache MISS
23:07:00 SILL PuppetPadchat roomMemberRawPayload(6350854677@chatroom)
23:07:00 VERB PuppetPadchatManager roomMemberRawPayload(6350854677@chatroom)
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_seytcj5hxxsh12 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 SILL Puppet roomMemberPayloadCache(6350854677@chatroom) cache MISS
23:07:00 SILL PuppetPadchat roomMemberRawPayload(6350854677@chatroom)
23:07:00 VERB PuppetPadchatManager roomMemberRawPayload(6350854677@chatroom)
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=lizhuohuan noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 SILL Puppet roomMemberPayloadCache(6350854677@chatroom) cache MISS
23:07:00 SILL PuppetPadchat roomMemberRawPayload(6350854677@chatroom)
23:07:00 VERB PuppetPadchatManager roomMemberRawPayload(6350854677@chatroom)
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 SILL Puppet roomMemberPayloadCache(6350854677@chatroom) cache MISS
23:07:00 SILL PuppetPadchat roomMemberRawPayload(6350854677@chatroom)
23:07:00 VERB PuppetPadchatManager roomMemberRawPayload(6350854677@chatroom)
23:07:00 SILL PuppetPadchat roomMemberRawPayloadParser([object Object])
23:07:00 SILL PuppetPadchat roomMemberRawPayloadParser([object Object])
23:07:00 SILL PuppetPadchat roomMemberRawPayloadParser([object Object])
23:07:00 SILL PuppetPadchat roomMemberRawPayloadParser([object Object])
23:07:00 SILL Puppet roomMemberPayload(6350854677@chatroom) cache SET
23:07:00 SILL Puppet roomMemberPayload(6350854677@chatroom) cache SET
23:07:00 SILL Puppet roomMemberPayload(6350854677@chatroom) cache SET
23:07:00 SILL Puppet roomMemberPayload(6350854677@chatroom) cache SET
23:07:00 VERB Puppet roomMemberSearch(6350854677@chatroom, {"name":"太阁_传话助手"})
23:07:00 VERB PuppetPadchat roomMemberList(6350854677@chatroom)
23:07:00 VERB PuppetPadchatManager getRoomMemberIdList(6350854677)
23:07:00 VERB PuppetPadchatManager getRoomMemberIdList(6350854677) length=4
23:07:00 SILL PuppetPadchat roomMemberList()=4
23:07:00 VERB Puppet contactSearch(query={"name":"太阁_传话助手"}, idList.length = 4)
23:07:00 SILL Puppet contactPayload(wxid_seytcj5hxxsh12) cache MISS
23:07:00 SILL PuppetPadchat contactRawPayload(wxid_seytcj5hxxsh12)
23:07:00 SILL PuppetPadchatManager contactRawPayload(wxid_seytcj5hxxsh12)
23:07:00 SILL Puppet contactPayload(lizhuohuan) cache MISS
23:07:00 SILL PuppetPadchat contactRawPayload(lizhuohuan)
23:07:00 SILL PuppetPadchatManager contactRawPayload(lizhuohuan)
23:07:00 SILL Puppet contactPayload(wxid_lredtm37y7rc22) cache MISS
23:07:00 SILL PuppetPadchat contactRawPayload(wxid_lredtm37y7rc22)
23:07:00 SILL PuppetPadchatManager contactRawPayload(wxid_lredtm37y7rc22)
23:07:00 SILL PuppetPadchatManager contactRawPayload(wxid_seytcj5hxxsh12) retry() attempt=1
23:07:00 SILL PuppetPadchatManager contactRawPayload(lizhuohuan) retry() attempt=1
23:07:00 SILL PuppetPadchatManager contactRawPayload(wxid_lredtm37y7rc22) retry() attempt=1
23:07:00 SILL PuppetPadchat contactRawPayloadParser({user_name="wxid_seytcj5hxxsh12"})
23:07:00 SILL PuppetPadchat contactRawPayloadParser({user_name="lizhuohuan"})
23:07:00 SILL PuppetPadchat contactRawPayloadParser({user_name="wxid_lredtm37y7rc22"})
23:07:00 SILL Puppet contactPayload(wxid_seytcj5hxxsh12) cache SET
23:07:00 SILL Puppet contactPayload(lizhuohuan) cache SET
23:07:00 SILL Puppet contactPayload(wxid_lredtm37y7rc22) cache SET
23:07:00 VERB Puppet contactQueryFilterFactory({"name":"太阁_传话助手"})
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_seytcj5hxxsh12 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=lizhuohuan noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberSearch(6350854677@chatroom, {"contactAlias":"太阁_传话助手"})
23:07:00 VERB PuppetPadchat roomMemberList(6350854677@chatroom)
23:07:00 VERB PuppetPadchatManager getRoomMemberIdList(6350854677)
23:07:00 VERB PuppetPadchatManager getRoomMemberIdList(6350854677) length=4
23:07:00 SILL PuppetPadchat roomMemberList()=4
23:07:00 VERB Puppet contactSearch(query={"alias":"太阁_传话助手"}, idList.length = 4)
23:07:00 VERB Puppet contactQueryFilterFactory({"alias":"太阁_传话助手"})
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_zj2cahpwzgie12 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_seytcj5hxxsh12 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=lizhuohuan noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberPayload(roomId=6350854677@chatroom, contactId=wxid_lredtm37y7rc22 noCache=false)
23:07:00 SILL Puppet roomMemberPayloadCache(id=6350854677@chatroom) @ PuppetPadchat<default>
23:07:00 VERB Puppet roomMemberSearch(6350854677@chatroom, undefined)
23:07:00 VERB PuppetPadchatManager purgeRoomMemberIdList(6350854677)
23:07:00 VERB Room ready()
23:07:00 SILL Accessory #13<Contact> constructor()
23:07:00 SILL Contact constructor(wxid_lredtm37y7rc22)
23:07:00 SILL Contact ready() @ PuppetPadchat<default>
23:07:00 SILL Contact ready() isReady() true
23:07:00 SILL Contact ready() @ PuppetPadchat<default>
23:07:00 SILL Contact ready() isReady() true
23:07:00 VERB Room topic()
23:07:00 INFO Bot EVENT: room-leave - Room ding - welcome 太阁_传话助手 lost member 太阁_传话助手
23:07:00 VERB Room topic()
23:07:00 VERB Room say(kick off 太阁_传话助手 from ding - welcome 太阁_传话助手!, )
23:07:00 VERB PuppetPadchat messageSend({"roomId":"6350854677@chatroom"}, kick off 太阁_传话助手 from ding - welcome 太阁_传话助手!)
23:07:00 SILL PadchatRpc rpcCall(WXSendMsg, ["6350854677@chatroom","kick off 太阁_传话助手 from ding - welcome 太阁_传话助手!",""])
23:07:01 VERB PuppetPadchat onPadchatMessage({id=6226126162641344476, type=Sys(5)})
rawPayload: { content: '你将"太阁_传话助手"移出了群聊',
  continue: 1,
  description: '',
  from_user: '6350854677@chatroom',
  msg_id: '6226126162641344476',
  msg_source: '',
  msg_type: 5,
  status: 1,
  sub_type: 10000,
  timestamp: 1528902420,
  to_user: 'wxid_zj2cahpwzgie12',
  uin: 324216852 }
23:07:01 VERB PuppetPadchat onPadchatMessageFriendshipEvent({id=6226126162641344476})
23:07:01 VERB PuppetPadchat onPadchatMessageRoomEvent({id=6226126162641344476})
23:07:01 VERB Puppet roomMemberSearch(6350854677@chatroom, "太阁_传话助手")
23:07:01 VERB Puppet roomMemberSearch(6350854677@chatroom, {"roomAlias":"太阁_传话助手"})
23:07:01 VERB PuppetPadchat roomMemberList(6350854677@chatroom)
23:07:01 VERB PuppetPadchatManager getRoomMemberIdList(6350854677)

We have two same message:

23:07:00 VERB PuppetPadchat onPadchatMessage({id=6226126162641344476, type=Sys(5)})

and

23:07:01 VERB PuppetPadchat onPadchatMessage({id=6226126162641344476, type=Sys(5)})

So we need to drop the same one.

@huan huan merged commit 1831ad6 into wechaty:master Jun 13, 2018
@lijiarui lijiarui deleted the room-bot-example branch July 30, 2018 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants