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

who's on call will return a block rather than individual mesages #79

Merged
merged 2 commits into from
Feb 9, 2016
Merged

Conversation

kaesackett
Copy link

The "who's on call" functionality intermittently works when the return payload is particularly large - sometimes returning only partial results, sometimes working perfectly, and sometimes returning nothing at all.

This PR address the issue of who's on call sending each returned item as an individual message by waiting for all results to be received and then concatenating them together. As an aside, it seems to fix the intermittent nature of the functionality due to hanging async requests, as described in #43.

@@ -570,9 +570,13 @@ module.exports = (robot) ->

scheduleName = msg.match[1]

messages = ["/code"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this specific to an adapter? Not sure what it does.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah. That is specific to HipChat. There should be some conditional statement there that adjusts depending on the adapter for this to work with Slack, etc. Is there a list somewhere of the supported adapters so that I could implement that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. I've seen this happen with quite a few packages needing to implement an adapter-specific feature, but I don't have a ready example of someone who has done it well. The robot.adapterName property should be populated for most recent versions of Hubot.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I found a list here https://hubot.github.com/docs/adapters/ and I don't think there's going to be any good way to support code-block formatting for all 30+ of those. I mean, it could be done, but the code would be convoluted and unreadable.

What could be done instead is to scrap the code-blocking, and just return the list joined with a newline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd say scrap it. Ideally, Hubot would have a DSL of output formats that could be sent along with a message, and the adapters would handle those properly. Until then, the best approach is to send it along raw.

@stephenyeargin
Copy link
Member

👍

stephenyeargin added a commit that referenced this pull request Feb 9, 2016
who's on call will return a block rather than individual mesages
@stephenyeargin stephenyeargin merged commit acfafe0 into hubot-archive:master Feb 9, 2016
@stephenyeargin
Copy link
Member

Released in v2.1.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants