Can not trigger listener sometimes.
yihchu opened this issue · 6 comments
Description
Describe your issue here.
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
hubot-slack version: ^4.10.0
node version: v14.15.3
OS version(s): cenos7.9
Steps to reproduce:
- new a hubot
- add it into a slack channel
- modify 'example.coffee'
- start hubot
Expected result:
After send 'hello', it replies 'Hello World.'
After send 'badger', it replies 'Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS'
Actual result:
Sometimes, it goes well, but sometimes, the same text can not trigger the listener.
Please see the logs.
Attachments:
I send 'hello' and 'badger', sometimes it goes well, like this:
[Fri Jul 15 2022 10:21:30 GMT+0800 (**标准时间)] DEBUG Message 'jokerr hello' matched regex //hello/i/; listener.options = { id: null }
[Fri Jul 15 2022 10:21:30 GMT+0800 (**标准时间)] DEBUG Executing listener callback for Message 'jokerr hello'
[Fri Jul 15 2022 10:21:30 GMT+0800 (**标准时间)] DEBUG SlackClient#send() room: D03PG99UQ7M, message: Hello World.
[Fri Jul 15 2022 10:21:38 GMT+0800 (**标准时间)] DEBUG Received text message in channel: D03PG99UQ7M, from: W9Z9MFWHG (human)
[Fri Jul 15 2022 10:21:38 GMT+0800 (**标准时间)] DEBUG Message 'jokerr badger' matched regex //badger/i/; listener.options = { id: null }
[Fri Jul 15 2022 10:21:38 GMT+0800 (**标准时间)] DEBUG Executing listener callback for Message 'jokerr badger'
[Fri Jul 15 2022 10:21:38 GMT+0800 (**标准时间)] DEBUG SlackClient#send() room: D03PG99UQ7M, message: Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS
But sometimes....
[Fri Jul 15 2022 10:17:34 GMT+0800 (**标准时间)] DEBUG Received text message in channel: D03PG99UQ7M, from: W9Z9MFWHG (human)
[Fri Jul 15 2022 10:17:43 GMT+0800 (**标准时间)] DEBUG Received file_shared message from: undefined, file_id: F03PP89C0BE
[Fri Jul 15 2022 10:17:43 GMT+0800 (**标准时间)] DEBUG No listeners executed; falling back to catch-all
Hi @yihchu, thanks for asking the question.
DEBUG Received file_shared message from: undefined, file_id: F03PP89C0BE
This log line indicates the message has an attached file. Thus, this one cannot be part of your screenshot. Please check the channel history again. Also, even when a message has attached files, as long as your message text contains "badger", your listener can react to the message for sure.
Hi @yihchu, thanks for asking the question.
DEBUG Received file_shared message from: undefined, file_id: F03PP89C0BE
This log line indicates the message has an attached file. Thus, this one cannot be part of your screenshot. Please check the channel history again. Also, even when a message has attached files, as long as your message text contains "badger", your listener can react to the message for sure.
Hi @seratch ,please check this.
#642 (comment)
I reproduced, and I take a new screenshot and logs.
Hi @yihchu, I've checked your comment in #642 and tried to see the same situation on my end. However, my Hubot app does not miss any messages. Also, we do not see any outage / incident reports on the RTM API (= underlying WebSocket connectivity) at this moment.
The only possible cause that I can think of is that your Hubot app's WebSocket connection might be a bit unstable due to something specific to your network environment (or anything between Slack server and your Hubot app process). In this case, the Slack server-side could occasionally fail to send message events to your app.
To narrow the issue down, I would suggest trying to run the same app in a completely different setting (say, on a different cloud service) and see how it goes. If your situation persists regardless of where to run your Hubot app, something wrong may be happening to your workspace or Hubot app configuration. To resolve this, please contact our customer support team from either /feedback
in your Slack workspace or https://my.slack.com/help/requests/new .
Lastly, if you don't have any particular reason to use Hubot, we highly recommend using a newer platform feature for new app development. Most of the things that Hubot w/ Slack adapter can be done with Bolt framework along with Socket Mode + Events API in a better way. Refer to the Getting Started Guide for learning how to use it.
I hope this was helpful to you and everything will work well for you soon.
Hi @yihchu, I've checked your comment in #642 and tried to see the same situation on my end. However, my Hubot app does not miss any messages. Also, we do not see any outage / incident reports on the RTM API (= underlying WebSocket connectivity) at this moment.
The only possible cause that I can think of is that your Hubot app's WebSocket connection might be a bit unstable due to something specific to your network environment (or anything between Slack server and your Hubot app process). In this case, the Slack server-side could fail to occasionally send message events to your app.
To narrow the issue down, I would suggest trying to run the same app in a completely different setting (say, on a different cloud service) and see how it goes. If your situation persists regardless of where to run your Hubot app, something wrong may be happening to your workspace or Hubot app configuration. To resolve this, please contact our customer support team from either
/feedback
in your Slack workspace or https://my.slack.com/help/requests/new .Lastly, if you don't have any particular reason to use Hubot, we highly recommend using a newer platform feature for new app development. Most of the things that Hubot w/ Slack adapter can be done with Bolt framework along with Socket Mode + Events API in a better way. Refer to the Getting Started Guide for learning how to use it.
I hope this was helpful to you and everything will work well for you soon.
@seratch Thanks. Could you tell me the ports that hubot uses.
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.