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

调用私发/群内发消息接口,emit出的消息事件中消息时间有误 #1619

Closed
zhaokefei opened this issue Oct 10, 2018 · 0 comments

Comments

@zhaokefei
Copy link

正常情况下接收的消息事件中的消息时间都是当前时间,但是通过调用发送消息接口后emit出来的消息时间不对。

造成这种问题可能的情况,经过根据错误时间的比对测试发现消息时间的时间戳有可能将毫秒和秒的单位搞错了导致的这种情况,麻烦排查下。

以下为测试时的日志:

  • 私发消息(关注最后一行的msgTime字段, 取自message.date()的值)
10:08:39 INFO {"command": "send_privite_message", "body": {
        "receiverId": "xxxx",
        "msgType": 7,
        "content": "私发消息",
        "title": "",
        "description": "",
        "thumbnailUrl": ""
    }}
10:08:39 VERB Contact say(私发消息)
10:08:39 VERB PuppetPadchat messageSend({"contactId":"xxx"}, 私发消息)
10:08:39 SILL PadchatRpc rpcCall(WXSendMsg, ["xxxx","私发消息",""])
10:08:39 SILL PadchatRpc initWebSocket() ws.on(message): {"apiName":"WXSendMsg","data":"%7B%22message%22%3A%22%22%2C%22msg_id%22%3A%223415405007824919250%22%
10:08:39 SILL PadchatRpc initHeartbeat() throttleQueue.subscribe(ws.on(message))
10:08:39 SILL PuppetPadchat startWatchdog() padchatManager.on(heartbeat)
10:08:39 SILL Wechaty memoryCheck() free: 5112 MB, require: 4 MB
10:08:39 SILL PadchatRpc generateBaseMsg(3415405007824919250,xxxx) {"content":"","continue":0,"description":"","from_user":"wxid_oszlo6z2jc6z12","msg_id":"3415405007824919250","msg_source":"","msg_type":5,"status":1,"sub_type":49,"timestamp":1539137319791,"to_user":"xxxx","uin":0}
10:08:39 SILL PadchatRpc replayTextMsg replaying message: {"content":"私发消息","continue":0,"description":"","from_user":"wxid_oszlo6z2jc6z12","msg_id":"3415405007824919250","msg_source":"","msg_type":5,"status":1,"sub_type":1,"timestamp":1539137319791,"to_user":"xxxx","uin":0}
10:08:39 VERB PuppetPadchat onPadchatMessage({id=3415405007824919250, type=Text(5)})
10:08:39 VERB Message static load(3415405007824919250)
10:08:39 SILL Accessory #251<Message> constructor()
10:08:39 VERB Message constructor(3415405007824919250) for class Message
10:08:39 VERB Message ready()
10:08:39 VERB Puppet messagePayload(3415405007824919250)
10:08:39 SILL Puppet messagePayloadCache(3415405007824919250) cache MISS
10:08:39 VERB PuppetPadChat messageRawPayloadParser({msg_id="3415405007824919250"})
10:08:39 SILL PuppetPadchat messagePayload({"id":"3415405007824919250","timestamp":1539137319791,"type":7,"fromId":"wxid_oszlo6z2jc6z12","text":"私发消息","toId":"xxxx"})
10:08:39 SILL Puppet messagePayload(3415405007824919250) cache SET
10:08:39 SILL Contact ready() @ Puppet#0<PuppetPadchat>(default)/PuppetPadchat#0
10:08:39 SILL Contact ready() isReady() true
10:08:39 SILL Contact ready() @ Puppet#0<PuppetPadchat>(default)/PuppetPadchat#0
10:08:39 SILL Contact ready() isReady() true
10:08:39 VERB Puppet selfId()
10:08:39 VERB Message mention()
10:08:39 VERB Puppet selfId()
10:08:39 INFO {"command":"private_message","body":{"msgId":"3415405007824919250","senderId":"wxid_oszlo6z2jc6z12","receiverId":"xxxx","receiverName":"🍏珂飞","robotId":"wxid_oszlo6z2jc6z12","msgType":7,"content":"私发消息","msgTime":"50743-04-28 16:23:11","title":"","description":"","thumbnailUrl":""}}
  • 群内发送消息(关注最后一行的msgTime字段值, 取自 message.date()的值)
10:12:54 SILL StateSwitch <Wechaty> off() is false
10:12:54 SILL StateSwitch <Wechaty> on() is true
10:12:54 INFO {"command":"health_check","body":{"hostName":"r-wechaty-connectorrc-9frmb","state":2}}
10:13:00 INFO {"command": "send_room_message", "body": {
        "roomId": "11301055708@chatroom",
        "all":  false,
        "userIds": [],
        "msgType": 7,
        "content": "群发消息",
        "title": "",
        "description": "",
        "thumbnailUrl": ""
    }}
10:13:00 VERB Puppet selfId()
10:13:00 INFO Room owner()
10:13:00 VERB Room say(群发消息, )
10:13:00 VERB PuppetPadchat messageSend({"roomId":"11301055708@chatroom"}, 群发消息)
10:13:00 SILL PadchatRpc rpcCall(WXSendMsg, ["11301055708@chatroom","群发消息",""])
10:13:00 SILL PadchatRpc initWebSocket() ws.on(message): {"apiName":"WXSendMsg","data":"%7B%22message%22%3A%22%22%2C%22msg_id%22%3A%22946474799531339012%22%2
10:13:00 SILL PadchatRpc generateBaseMsg(946474799531339012, 11301055708@chatroom) {"content":"","continue":0,"description":"","from_user":"wxid_oszlo6z2jc6z12","msg_id":"946474799531339012","msg_source":"","msg_type":5,"status":1,"sub_type":49,"timestamp":1539137580536,"to_user":"11301055708@chatroom","uin":0}
10:13:00 SILL PadchatRpc replayTextMsg replaying message: {"content":"群发消息","continue":0,"description":"","from_user":"wxid_oszlo6z2jc6z12","msg_id":"946474799531339012","msg_source":"","msg_type":5,"status":1,"sub_type":1,"timestamp":1539137580536,"to_user":"11301055708@chatroom","uin":0}
10:13:00 VERB PuppetPadchat onPadchatMessage({id=946474799531339012, type=Text(5)})
10:13:00 VERB Message static load(946474799531339012)
10:13:00 SILL Accessory #253<Message> constructor()
10:13:00 VERB Message constructor(946474799531339012) for class Message
10:13:00 VERB Message ready()
10:13:00 VERB Puppet messagePayload(946474799531339012)
10:13:00 SILL Puppet messagePayloadCache(946474799531339012) cache MISS
10:13:00 VERB PuppetPadChat messageRawPayloadParser({msg_id="946474799531339012"})
10:13:00 SILL PuppetPadchat messagePayload({"id":"946474799531339012","timestamp":1539137580536,"type":7,"fromId":"wxid_oszlo6z2jc6z12","roomId":"11301055708@chatroom","text":"群发消息"})
10:13:00 VERB Room topic()
10:13:00 SILL Puppet messagePayload(946474799531339012) cache SET
10:13:00 INFO {"command":"room_message","body":{"msgId":"","senderId":"wxid_oszlo6z2jc6z12","roomId":"11301055708@chatroom","roomName":"上海本地洗澡交流","robotId":"wxid_oszlo6z2jc6z12","atUserIds":[],"msgType":7,"content":"群发消息","msgTime":"2018-10-10 10:13:00","roomMasterId":"woriasi","isRobot":true,"title":"","description":"","thumbnailUrl":""}}
10:13:00 SILL Contact ready() @ Puppet#0<PuppetPadchat>(default)/PuppetPadchat#0
10:13:00 SILL Contact ready() isReady() true
10:13:00 VERB Room ready()
10:13:00 VERB Puppet selfId()
10:13:00 INFO Room owner()
10:13:00 VERB Message mention()
10:13:00 VERB Message mention() text = "群发消息", mentionNameList = "[]"
10:13:00 SILL Message message.mention() can not found member using room.member() from mentionList, metion string: []
10:13:00 VERB Puppet selfId()
10:13:00 VERB Room topic()
10:13:00 INFO {"command":"room_message","body":{"msgId":"946474799531339012","senderId":"wxid_oszlo6z2jc6z12","roomId":"11301055708@chatroom","roomName":"上海本地洗澡交流","robotId":"wxid_oszlo6z2jc6z12","atUserIds":[],"msgType":7,"content":"群发消息","msgTime":"50743-05-01 16:48:56","roomMasterId":"woriasi","isRobot":true,"title":"","description":"","thumbnailUrl":""}}

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

No branches or pull requests

1 participant