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

Restart required when chatting to new users #35

Closed
sunayansaikia opened this issue Feb 10, 2017 · 11 comments · Fixed by #57
Closed

Restart required when chatting to new users #35

sunayansaikia opened this issue Feb 10, 2017 · 11 comments · Fixed by #57

Comments

@sunayansaikia
Copy link

Hi,
I have encountered a big issue. Say you entered a slack domain and it has several users. When a new user that haven't yet talked to the JBot, the JBot fails to take inputs. But when a restart of the spring-boot service is done, those users who tried interacting with the bots and failed are now are able to interact.
Can you please, tell me where can the problem be as soon as possible. :)

@rampatra
Copy link
Owner

Hmm, it never happened to me. Let others comment on it too. Will keep this issue open.

@sunayansaikia
Copy link
Author

sunayansaikia commented Feb 11, 2017

Found the root cause. Inside the following method,
public final void handleTextMessage(WebSocketSession session, TextMessage textMessage)()

Root cause - Slack's im_created event gets triggered while talking to a newly added user.
As mentioned in this im_created event guide, this event should usually be followed by a im_open event which your code is looking for. But, that's not the case. I think, that's what they meant by 'usually'? Whatever be the case, I have added the check for the im_created in the code.

[Note]: Check this bug I raised in slack issues.

@rampatra
Copy link
Owner

Glad your issue is resolved.

@lurraca
Copy link
Contributor

lurraca commented Jun 26, 2017

@sunayansaikia I am facing the same issue. What do you mean by

added the check for the im_created in the code.

?

@lurraca
Copy link
Contributor

lurraca commented Jun 26, 2017

Ok, I think I got it.

I made the change on the Jbot source code to check for im_created and add the channel to DmChannels list, so when that new user sends a direct message to the bot, jbot is able to determine that is a DIRECT_MESSAGE. @ramswaroop is this something that you would like me to send a PR to fix it?

@rampatra
Copy link
Owner

rampatra commented Jun 26, 2017

Hi @lurraca, looks like jbot should check for both the events. Yes, definitely you can send a PR for the fix. Thanks a mil for contributing. 👍

@mndominguez
Copy link

I'm having this same issue. @ramswaroop do you think you can merge the PR? If the issue is that @lurraca did not change the code to check both event types, I can go ahead and do it. Thanks, great project BTW!

@rampatra
Copy link
Owner

@mndominguez okay I will do that today 👍

rampatra added a commit that referenced this issue Jul 28, 2017
@rampatra
Copy link
Owner

@mndominguez I just merged @lurraca PR #57.

@mndominguez
Copy link

@ramswaroop fantastic, thank you! Is the fix going to be on a new build on Maven Central?

@rampatra
Copy link
Owner

rampatra commented Jul 29, 2017

@mndominguez no it's not gone to maven yet. I will release it after some tests which may take some days as I am working on other new features as well.

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.

4 participants