Open umlaeute opened 4 years ago
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).
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.
same thing of mine, using GitLab auth, and there are no Wellcome message at all
@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
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 theDelayInSeconds
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?