Automatically adding people to a private chat channel is no longer working?

I updated my Discourse self-hosted install on Friday, I was about 2 weeks behind. My current version is 3.5.0.beta2-dev ( 712302c020 ).

I created a private chat channel based on one of our private categories and I said “yes” to automatically add the 7 users who had access to the category:

It didn’t work, the only user added was myself:

I tried searching for users to add, but I get 0 results, even other admins can’t be added:

There’s definitely a user available that could be added:

But again, the 7 people in the group should have been added in the first step anyway. I tried running the Jobs::Chat::AutoJoinUsers sidekiq job as well, but no luck. Additionally, I see no errors in the log either.

Before upgrading, I set up 2 other channels in the same way and this process worked perfectly.

I’ll try another update to the very latest, but the latest commits seem unrelated.

2 Likes

Edit: Solved! My bad, forgot to update the permissions Automatically adding people to a private chat channel is no longer working? [solved] - #12 by cultiv

Unfortunately an update to 3.5.0.beta2-dev ( 558c566ca8 ) didn’t help.

I can see that when I search a user that I should be able to add, that there’s 1 total_rows returned but the memberships array is empty:

Whereas if I search my own name, total_rows is also 1 and my account gets returned:

1 Like

Could it be something to do with this PR that was added before I did the upgrade?

Not sure how I could maybe downgrade to the commit before this one, then I can test if that was the cause of the problem :thinking:

And just to note, I have the same problem in the Dev version of my forum (a separate instance) and in my Live version. Both have upgraded past this PR above.

1 Like

I don’t have an immediate answer, but we will be looking at this, thanks.

3 Likes

I managed to downgrade to 3.5.0.beta1 and refreshed all my browser caches etc. But I am still facing this problem.

It’s extremely weird, I know I was on a recent version, less than 2 weeks old. It worked there, I set up 2 channels with auto-adding people, when I said “yes” to add people from an existing group that all went through perfectly.

Now, I tried again and it doesn’t work properly, except for 1 channel. Just to illustrate:

All of these should have 6 or more members. When there’s 1 member, it’s just me. The “Diversity equity and inclusion team” there is the only one that consistently adds all the members of the group.
The “Packages team” on my live site, worked beautifully when I created it, all 10 people were added. It worked on the dev site as well before. Now when I remove it and add it again on the dev site, it consistently only gets 3 members added.
I have compared the groups and all the group settings are exactly the same. I removed and added people in groups, that didn’t make a difference either.

Finally, when I add a user to the group that had never been part of that group before, it seems to add it to the chat channel. But when I remove and add an existing member, the same doesn’t happen.
I even deleted the chat channel, removed people from the group, added the chat channel again and added the old users back to the group. That didn’t work. Adding a random other user in.. DOES work.

Maybe something is completely messed up in my instance.. I don’t have a chance to test it in a fresh instance.

I am happy to give some SSH access and admin access to the dev site, it’s a dev site so I’m fine with messing up anything and everything :sweat_smile: :joy:

Edit: upgraded now to the very latest commit from a few hours ago. I tried to add a brand new group (with the same people in it) to an existing private category and see if that would help, but same result, nobody gets added to the chat channel.

Have any of the other users been active on your Discourse since you created the channel? Or logged out and logged back in again?

I just tried to recreate this and yeah, I was only seeing one member in the channel right after creation. Every time I logged in as each of the other users that had access to the category, the member count would go up. Those users were able to see the full channel history so that didn’t start only from when they logged in.

So it looks like it’s a UX/UI bug - it would definitely be less confusing if that members list was populated immediately with whoever has access!

Thanks for having a look! I am afraid that most people have been online quite recently and even when I impersonate a few of them, they still don’t get added to the category chat channel.

It does make sense though, that I can not add the people if they’re already in the chat channel. But unfortunately they can neither see the channel nor go to the direct URL for it.

I should probably add that I have categories set up like so:

  • Community teams
    • Core collaborators team
    • Package team

etc. All the groups have access to the top level category and each individual group has access to their own sub category. I doubt that makes any difference, since it does work for some teams.

I even tried to add some people manually in the database (INSERT INTO user_chat_channel_memberships.. ) but either I’m not updating the correct tables, or it just doesn’t want to work for another reason. Either way I am not having any luck with this one :sweat_smile:

Found the problem, which was me.. :person_facepalming:

Going through everything once more, of course I noticed that in “Chat allowed groups” not all the groups were added. On our site, we’re pretty strict on who can chat or not and I forgot I set up only specific “Chat allowed groups” :see_no_evil_monkey:

Problem solved and thanks for the feedback!

1 Like