travisghansen / node-red-slack

A node-red module to post to Slack.com
MIT License
22 stars 29 forks source link

Slack Bot In node doesn't handle connection problem #15

Closed janvda closed 5 years ago

janvda commented 6 years ago

Hi,

First and foremost my appreciation for these excellent slack nodes.

I am using these nodes for quite some time and the thing I noticed is that after some time (even some days) my [Slack Bot In] node no longer receives any slack messages (in the slack - I also see under "Apps" that it is no longer connected to the "Slack Bot").

I think that the connection between the [Slack Bot In] node and slack is broken and that this connection is not automatically restored. So I need to restart or redeploy my node red application to get it working again.

Note also that no error message is logged in the node red log files when this connection drops and there is also no status indication when consulting the [Slack Bot In] node in the node red editor.

kr Jan

travisghansen commented 5 years ago

I've updated the documentation used in the Node-RED UI now and committed. If you install the latest version (you must actually refresh the tab/browser after upgrade) you'll see the in-app documentation. Please review and provide any comments/feedback.

I pretty well consider this code/doc/etc complete at this point and looking for any final feedback before merging and publishing to npm registry.

Thanks everyone for the feedback so far! It's definitely made the product better.

Related to this actual issue, has anyone seen any reconnect issues of late?

travisghansen commented 5 years ago

I've landed more documentation updates and some minor fixes etc. The latest slack-rtm-in node allows you to set a node property limiting which events it emits. I updated the slack client version. Real close now...

janvda commented 5 years ago

so far from my end I didn't encounter any reconnect issues. So this is excellent !!

travisghansen commented 5 years ago

@janvda great to hear!

I've just committed some additional documentation (examples for each node) along with the npm lock file. Unless any further issues come up I now consider it code complete and ready for merge and publish.

shanness commented 5 years ago

I second that, no reconnect issues (although my fix on the orig code base was already stable). Great work! I've also had a presence subscription running stably too. Seems ready to merge and publish to me.

travisghansen commented 5 years ago

@shanness that's awesome! Are you finding the presence (and/or DND) abilities useful?

janvda commented 5 years ago

@travisghansen excellent work - I also consider it ready for merge and publish !!!

shanness commented 5 years ago

@travisghansen Not using them yet, just logging them to see how stable they are if they could be used to hook in with our live chat availability and possibly for deciding who should be tagged when posting warnings etc to slack. I'm just subscribing a fixed set of userids 10 seconds after redeployment (giving time for the connection to come up) BTW, rather than waiting for 10 mins and using the state cache. Simpler setup and makes testing flow changes faster :)

travisghansen commented 5 years ago

@shanness if I understand the logic you should be able to use the 2nd output of slack-state as it emits when everything is initialized on (re) connect (basically added for this purpose). See the current presence example in the README.md with more explanation.

That should prevent the need for arbitrary waits etc. It also includes instructions on how to keep things updated over time.

Also note, the state cache is generally ready pretty quickly. It just refreshes every 10 minutes for good measure but it's generally ready (ie: emits a msg on the 2nd output) within a second or so. If you have thousands of users/channels it make take a few seconds but generally it's ready immediately.

yayadrian commented 5 years ago

I have now published version 2.0.0 to NPM. Massive thanks to @travisghansen for his rewrite and fixing all my issues. Thanks to @shanness @janvda for your testing and raising these issues

travisghansen commented 5 years ago

Yay! Thanks everyone for all the feedback!

yayadrian commented 5 years ago

Closing this issue as it is resolved in version 2.0.0

shanness commented 5 years ago

Thanks @travisghansen , took your advice re the state node and subscribing, working perfectly :)

Thanks again for all the excellent work, node red now has kick arse slack integration :)

travisghansen commented 5 years ago

Already reaping the benefits of generic API methods: https://api.slack.com/methods/chat.scheduleMessage

:)

shanness commented 5 years ago

Hmm nice! This is an API way of doing /remind I assume?

travisghansen commented 5 years ago

Never used either...just looks like delayed message sending. Just saw it in the API email slack sent out.

salemh commented 3 years ago

I have now published version 2.0.0 to NPM. Massive thanks to @travisghansen for his rewrite and fixing all my issues. Thanks to @shanness @janvda for your testing and raising these issues

Is it still working. It seems all connections and nodes are no more working on Node-red!!!

shanness commented 3 years ago

Still working for me. Been rock solid for a couple of years :)

craig $help

cmd APP Valid commands :-
$bounce [live|beta]
$alert [craig,cam,cam2] [normal,high,emergency] the message
   -- run $alert by itself for more info
travisghansen commented 3 years ago

@salemh usually if you have connection problems it’s because you’re not using an appropriate token. I think they call them ‘legacy’ these days.

I have been meaning to do some minor updates to the integration at some point including support for newer tokens but don’t have any kind of timeline.

salemh commented 3 years ago

Is there a step by step go through for configuration some where?

Get Outlook for Androidhttps://aka.ms/ghei36


From: Travis Glenn Hansen @.> Sent: Saturday, July 24, 2021 6:27:34 PM To: yayadrian/node-red-slack @.> Cc: salemh @.>; Mention @.> Subject: Re: [yayadrian/node-red-slack] Slack Bot In node doesn't handle connection problem (#15)

@salemhhttps://github.com/salemh usually if you have connection problems it’s because you’re not using an appropriate token. I think they call them ‘legacy’ these days.

I have been meaning to do some minor updates to the integration at some point including support for newer tokens but don’t have any kind of timeline.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/yayadrian/node-red-slack/issues/15#issuecomment-886061112, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABMRDSQXM2SVYD75ZYYXHOTTZLEVNANCNFSM4EOTACKA.

travisghansen commented 3 years ago

A cursory look shows this..