Closed TKonczynski closed 5 years ago
/cc @awiddersheim
@TKonczynski I guess I'm not sure what you mean by "multiple matches". Can you give a more fleshed out example of what your schedules look like and the responses?
@awiddersheim Sure! :) Let's just elaborate on what I've written with a clearer example.
Let's say I want to check the schedule of a team called 'Utilities', so I go ahead and type
who's on call for Utilities
However, there are more teams who have the word Utilities in their names, say, Useful Utilities, Necessary Utilities, Essential Utilities, Expendable Utilities, so I will get more that one response, because my query matches more than 1 result. Let's say there are 4 teams in total - the ones that I've mentioned The result that I expect to get after running this command is:
Person A is on call for Useful Utilities
Person B is on call for Necessary Utilities
Person C is on call for Essential Utilities
Person D is on call for Expendable Utilities
However, what I get instead is 4 replies one by one (because there are 4 teams), with each reply having one more line than the previous one; it looks like this:
Person A is on call for Useful Utilities
Person A is on call for Useful Utilities
Person B is on call for Necessary Utilities
Person A is on call for Useful Utilities
Person B is on call for Necessary Utilities
Person C is on call for Essential Utilities
Person A is on call for Useful Utilities
Person B is on call for Necessary Utilities
Person C is on call for Essential Utilities
Person D is on call for Expendable Utilities
Basically: the program should loop n times and display all results at the end of the loop, while now it displays the result after each run inside the loop.
@TKonczynski thanks for the fleshed out example. I'll take a look and get back to you.
@TKonczynski unfortunately, I'm no longer in a position where I can really deep dive on this anymore.
There was some deep debugging done on the same code area just recently in https://github.com/hubot-scripts/hubot-pager-me/issues/92. You can start adding some debug statements and some of the stuff in that issue might help you in doing that.
Might also want to try this diff in particular https://github.com/hubot-scripts/hubot-pager-me/issues/92#issuecomment-232828988.
Thank you for you response, I'l look up #92
I have this same looping behavior. The diff referenced in #92 does fix the issue for me.
@mcg which diff specifically?
@mcg great thanks. That diff is basically a rollback of https://github.com/hubot-scripts/hubot-pager-me/pull/79.
Whenever I type "Who's on call for XYZ", and there are more matches than just XYZ, then the replies loop, displaying +1 entry every time.
Example:
A batch of responses comes, one after another:
...and so on, until it loops through all the possible matches of XYZ