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

welcomebot not displaying #58

Open
umlaeute opened this issue Sep 8, 2020 · 4 comments
Open

welcomebot not displaying #58

umlaeute opened this issue Sep 8, 2020 · 4 comments
Labels
Type/Bug Something isn't working

Comments

@umlaeute
Copy link

umlaeute commented Sep 8, 2020

i'm running Mattermost-5.26.0, with a single ("Primary") team named chat.

I have installed the welcomebot-1.2.0 and configured it to add new users to a couple of channels (and ask them whether they want to be added to even more channels).

When i run /welcomebot preview chat the messages are displayed nicely (though the DelayInSeconds is ignored; i guess this is itentional).

However, when i create a new user and let them log-in for the first time, no messages are displayed at all.

What could possibly be wrong?

The users are imported with bin/mattermost import bulk /path/to/users.json (as self sign-up has been disabled).

If i set a channel-welcome with /welcomebot set_channel_welcome blablabla this gets displayed nicely.

Any hints?

@umlaeute
Copy link
Author

umlaeute commented Sep 8, 2020

so my bulk-data looks like this:

{"type": "version", "version": 1}
{"type": "user", "user": {"first_name": "Jane", "last_name": "Random", "nickname": "Jane", "email": "jane@example.com", "username": "jane", "password": "SUPERSECRET", "position": "CEO of ACME.com", "locale": "en", "roles": "system_user", "teams": [{"name": "chat", "roles": "team_user"}]}}

afaict, the problem is, that the user gets automatically added to the team in the import.

However, the welcomebot itself is executed when the user is added by the team: https://github.com/mattermost/mattermost-plugin-welcomebot/blob/c367ba629bab523ffdc5e0d3a3e17207ab80b6c8/server/hooks.go#L12-L14

since the user is not online when they are added (in the bulk import), the welcomebot displays its message when they can't see it (or not at all, but that doesn't really matter).
When the user logs in for the first time, the welcomebot is no longer concerned with displaying any messages to them.

For now, I probably just won't add the users to the the primary/sole team in the import.

This is suboptimal, as it requires the users to actively join the team (even if there is only one).
This is probably not a problem, if the users are told to join the chat, but in our case we are using mattermost as the SSO-server for a conference and people are actually attempting to login to the conference page rather than the chat server (so the more they have to interact with the chat-server at that stage, the more they will get confused; that's why i would prefer to automate as much as possible for them).

@nylocx
Copy link

nylocx commented May 22, 2023

I think I stumbled over similar behavior I have just a single team and SSO and as soon as the user signs he gets assigned to this team as it's the only joinable public team. But no message or auto-join is happening. I double checked the config and /welcomebot preview my-team works as expected.

@afteroot
Copy link

afteroot commented Jun 7, 2023

same thing of mine, using GitLab auth, and there are no Wellcome message at all

@Kshitij-Katiyar Kshitij-Katiyar added the Type/Bug Something isn't working label Apr 16, 2024
@raghavaggarwal2308
Copy link

raghavaggarwal2308 commented Apr 17, 2024

@umlaeute @mickmister

  • In the welcome bot, the team welcome message is processed in the UserHasJoinedTeam() hook. The UserHasJoinedTeam() hook is invoked in every function related to a user joining the team. However, when inviting users in bulk through file upload, the user is added to the user database through a separate SQL query No function related to a user joining the team is called in this scenario, which is why the UserHasJoinedTeam() hook is not invoked when inviting a user to the team through bulk invite.

  • For Gitlab auth SSO, the expected team welcome message was received in case of a single user joining the team with GitLab auth with account creation enabled on my server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type/Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants