Ich habe einen ziemlich großen Fehler (glaube ich) im #Staff-Chat gefunden. Wenn ein Benutzer aus dem Staff entfernt wird, wird er nicht aus dem Staff-Chat entfernt. Es sei denn, es gibt eine Möglichkeit, ihn zu entfernen, die ich übersehe? Es scheint, als ob dies automatisch geschehen sollte.
9 „Gefällt mir“
j.jaffeux
(Joffrey Jaffeux)
15. Juli 2022 um 16:42
3
Werde mich heute später darum kümmern danke
8 „Gefällt mir“
j.jaffeux
(Joffrey Jaffeux)
15. Juli 2022 um 19:14
5
Wir haben dies intern als TODO markiert, dies wird sicher nicht vor nächster Woche behoben sein. Es wird eine meiner Prioritäten für nächste Woche sein, Entschuldigung dafür.
7 „Gefällt mir“
mcwumbly
(Dave McClure)
20. Juli 2022 um 17:49
6
Eine Sache, die ich klarstellen möchte, ist, dass Benutzer, die aus dem Personal oder einer anderen Gruppe entfernt wurden, die Kanäle, auf die sie keinen Zugriff mehr haben, nicht sehen können und keine Nachrichten in diesen Kanälen sehen oder senden können, auch wenn sie immer noch als Mitglieder des Kanals aufgeführt sind.
Es ist jedoch immer noch irreführend, und wir haben dies ganz oben auf unserer Liste.
Wir werden uns bald darum kümmern und planen, uns die Zeit zu nehmen, die erforderlich ist, um die verschiedenen Fälle zu sortieren, die möglicherweise bestehen, in denen der Zugriff und die Mitgliedschaft von Benutzern in Kanälen möglicherweise entfernt werden müssen.
9 „Gefällt mir“
sam
(Sam Saffron)
30. Oktober 2025 um 01:43
7
Das ist durchgerutscht, aber ich bin mir ehrlich gesagt nicht sicher, was eine sinnvolle Lösung ist.
Wir könnten „Konsistenz sicherstellen“ und ab und zu einen Job ausführen, der Benutzer ohne Zugriff entfernt.
Wir könnten „die Informationen ausblenden“ und die Benutzer ohne Zugriff, die sich irgendwie in einem Kanal befinden, nicht rendern.
Bevor wir hier etwas unternehmen, sollten wir entscheiden, welches unser gewünschtes Verhalten ist.
mcwumbly
(Dave McClure)
30. Oktober 2025 um 01:58
8
Moment mal… Ich bin hier nie darauf zurückgekommen, aber das sind einige verwandte Änderungen, die damit zusammengeführt wurden:
main ← feature/remove-users-without-permission-from-channel
opened 04:06AM - 17 Feb 23 UTC
There are many situations that may cause users to lose permission to
send messa… ges in a chat channel. Until now we have relied on security
checks in `Chat::ChatChannelFetcher` to remove channels which the
user may have a `UserChatChannelMembership` record for but which
they do not have access to.
This commit takes a more proactive approach. Now any of these following
`DiscourseEvent` triggers may cause `UserChatChannelMembership`
records to be deleted:
* `category_updated` - Permissions of the category changed
(i.e. CategoryGroup records changed)
* `user_removed_from_group` - Means the user may not be able to access the
channel based on `GroupUser` or also `chat_allowed_groups`
* `site_setting_changed` - The `chat_allowed_groups` was updated, some
users may no longer be in groups that can access chat.
* `group_destroyed` - Means the user may not be able to access the
channel based on `GroupUser` or also `chat_allowed_groups`
All of these are handled in a distinct service run in a background
job. Users removed are logged via `StaffActionLog` and then we
publish messages on a per-channel basis to users who had their
memberships deleted.
When the user has a channel they are kicked from open, we show
this dialog.
<img src="https://user-images.githubusercontent.com/920448/221748981-248e6d89-1b81-454d-9744-b0d0e68a6c2e.png" width="400">
When they click OK we redirect them either:
* To their first other public channel, if they have any followed
* The chat browse page if they don't
This is to save on tons of requests from kicked out users getting messages
from other channels.
When the user does not have the kicked channel open, we can just
silently yoink it out of their sidebar and turn off subscriptions.
main ← perf-chat-auto-join-take-42
opened 04:35PM - 14 Oct 24 UTC
Chat channels that are linked to a category can be set to automatically join use… rs.
This is handled by subscribing to the following events
- group_destroyed
- user_seen
- user_confirmed_email
- user_added_to_group
- user_removed_from_group
- category_updated
- site_setting_changed (for `chat_allowed_groups`)
As well as a
- hourly background job (`AutoJoinUsers`)
- `CreateCategoryChannel` service
- `UpdateChannel` service
There was however two issues with the current implementation
1. We were triggering a lot of background jobs, mostly because it was decided to batch to auto join/leave into groups of 1000 users, adding a lot of stress to the system
2. We had one "class" (a service or a background job) per "event" and all of them had slightly different ways to select users to join/leave, making it hard to keep everything in sync
This PR "simply" adds two new services. `AutoJoinChannels` and `AutoLeaveChannels` that takes care, in an efficient way, of all the cases when users might automatically join and leave a chat channel.
Every other changes come from the fact that we're now always calling either one of those services, depending on the event that happened.
In the making of these classes, a few bugs were encountered and fixed, notably
- The `chat_allowed_group` site setting was missing the (dynamic) `@staff` group
- A user is only ever able to access chat channels if and only if they're part of a group listed in the `chat_allowed_group` site setting
- A category that has no associated "category groups" is only accessible to staff members (and not "Everyone")
- A silenced user should not be able to automatically join channels
- We should not attempt to automatically join users to deleted chat channels
- There is no need to automatically join users to chat channels that have already more than `max_chat_auto_joined_users` users
Internal - t/135259 & t/70607
1 „Gefällt mir“
sam
(Sam Saffron)
30. Oktober 2025 um 02:01
9
Okay, ich werde dies dann schließen. Wir können neue Fehler wieder eröffnen, wenn wir nach diesen Änderungen neue Ausnahmefälle entdecken.
1 „Gefällt mir“