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

Controller method order causes conversation methods to be called in error #147

Open
jsutherl opened this issue Feb 22, 2019 · 0 comments · May be fixed by #175
Open

Controller method order causes conversation methods to be called in error #147

jsutherl opened this issue Feb 22, 2019 · 0 comments · May be fixed by #175

Comments

@jsutherl
Copy link

If conversations aren't defined in top to bottom fashion ( method containing startConversation is below its "next" method), they get called when a new message comes in that doesn't match any defined patterns.
(To see this in action, in the example, just move setupMeeting to the bottom of that file, and send a message that doesn't match the onReceiveMessage's pattern )

The issue starts with the constructor of BaseBot.
this.getClass().getMethods() will return the methods in no particular order. Normally, they will be in their line number order, but not necessarily.
When the methods are "out of order", this line if ( !conversationMethodNames.contains( method.getName() ) ) adds a next method to the eventToMethodsMap in error, as that method's previous might not have been added.

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.

1 participant