mattermost-community / mattermost-plugin-welcomebot

Apache License 2.0
65 stars 41 forks source link

welcomebot not displaying #58

Open umlaeute opened 4 years ago

umlaeute commented 4 years ago

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 commented 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).

nylocx commented 1 year ago

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 commented 1 year ago

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

raghavaggarwal2308 commented 4 months ago

@umlaeute @mickmister