node-slack-sdk: error: message received with unknown reply_to after every message
Hello,
I noticed that I’m seeing this error every time I send a message. It’s happening because, after sending a message, my app sees two responses. Upon sending a message, e.g.:
{ text: 'Foo',
channel: 'G1Q9TF94J',
type: 'message',
id: 1 }
It first sees the message it just posted (the “echo”):
{ reply_to: 1,
type: 'message',
channel: 'G1Q9TF94J',
user: 'U1Q2DRD6D',
text: 'Foo',
ts: '1468520040.000085' }
It later receives an ack for the same message:
{ ok: true,
reply_to: 1,
ts: '1468520064.000086',
text: 'Foo' }
The first incoming message (the echo) causes the message state to be cleared inside RTMClient.prototype._handleMsgResponse
; when the second message arrives (the ack), the state has been cleared so I get the error message received with unknown reply_to
.
To put this in more concrete terms, after sending a message, I’m getting both a messageAck and a mostRecentMsgReply (echo). The only way I can think of solving this is to store a separate list of valid outgoing replyTo IDs and, when an ack or echo comes back for one of these, for which the handler has already been called, we just drop it silently.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 21 (7 by maintainers)
@chenfanggm at this point i’m open to accepting PRs that can resolve the issue and/or implement tests that verify the correct behavior. we haven’t begun to work on a fix yet, and i personally consider this a medium priority issue because its an annoyance but hasn’t caused complete failure in the wild.
As mentioned in https://github.com/slackapi/node-slack-sdk/issues/300#issuecomment-266804306 you can only use channel/group/DM id’s. You cannot use channel names, user names, or user id’s.