-
Notifications
You must be signed in to change notification settings - Fork 640
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
WIP: Emit debugging events #567
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,10 +192,13 @@ class SlackClient | |
thread_ts: envelope.message?.thread_ts | ||
|
||
if typeof message isnt "string" | ||
@web.chat.postMessage(room, message.text, _.defaults(message, options)) | ||
messageOptions = _.defaults(message, options) | ||
@robot.emit "postMessage", room, message.text, messageOptions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the goal is just to understand when instead, i think the goal should be to turn on more logging, specifically for the what do you think? |
||
@web.chat.postMessage(room, message.text, messageOptions) | ||
.catch (error) => | ||
@robot.logger.error "SlackClient#send() error: #{error.message}" | ||
else | ||
@robot.emit "postMessage", room, message, options | ||
@web.chat.postMessage(room, message, options) | ||
.catch (error) => | ||
@robot.logger.error "SlackClient#send() error: #{error.message}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it took quite a bit of detective work, but it turns out that we don't know of any code that triggers the
"error"
event on theRtmClient
, which is the only code path that results in this method ever getting called.it seems like the comparison of
code
to-1
is remnants from the v3.x series ofhubot-slack
, which used the v1.x series of@slack/client
, which would have emitted a"error"
event.therefore, i don't think this code is worth merging, because it would just become even more misleading.