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

Hubot sends multiple packets to api upon 2+ vm creations #1

Closed
quickjp2 opened this issue Dec 14, 2015 · 6 comments · Fixed by #7
Closed

Hubot sends multiple packets to api upon 2+ vm creations #1

quickjp2 opened this issue Dec 14, 2015 · 6 comments · Fixed by #7

Comments

@quickjp2
Copy link
Member

The second time the first vm packet is sent along with several copies of the new vm.

@quickjp2
Copy link
Member Author

Hubot will respond twice after the mem answer, then three times after the next, then four after the next, finally sending off 5 different json packets.

@quickjp2
Copy link
Member Author

Refactored the code in a new branch, but now the issue is the callback function passed to the respond object for a question is being called once when declared and then again when actually responding.
hubotresponseerror

@quickjp2
Copy link
Member Author

hubotresponseerrorp2

@quickjp2
Copy link
Member Author

The two pictures show that the callback function is being called once before the user response and once after. I purposely prevented the next call from being executed until the dual call issue is fixed.

@heckj
Copy link
Contributor

heckj commented Dec 29, 2015

hey @quickjp2

I think you're misreading the error - the issue isn't that askQuestion is getting called multiple times (looks like it's designed very much to be called recursively), but that it can't find the reference to itself:

ReferenceError: askQuestion is not defined

@quickjp2
Copy link
Member Author

Indeed! It is meant to be recursive. But the problem is not that it's not recursing (if that's even a word). The issue is that recursive function is being called before I even respond to it.

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

Successfully merging a pull request may close this issue.

2 participants