0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/plugins/chat/db
Martin Brennan 1bb4f9ed40
FIX: Recreate missing user_chat_channel_memberships for DMs (#40560)
Fixes an issue caused by enabling
granular_anonymous_and_logged_in_groups_permissions
for most sites, which an issue in
Chat::AutoJoinUsers/Chat::AutoLeaveChannels which
meant that chat channel memberships were deleted if
SiteSetting.chat_allowed_groups_map
did not include everyone, which it didn't when the UC was enabled.

The root cause was fixed in bc5ed461d7,
but this commit adds a post-migration to recreate the missing
user_chat_channel_memberships for DMs based on direct_message_users.

This does nothing to fix category channel memberships, because those
do not have a "secondary" record to compare against, but hopefully
those are mostly auto-resolved by the auto_join_users channel setting.
2026-06-04 09:09:39 +02:00
..
fixtures DEV: properly namespace chat (#20690) 2023-03-17 14:24:38 +01:00
migrate DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
post_migrate FIX: Recreate missing user_chat_channel_memberships for DMs (#40560) 2026-06-04 09:09:39 +02:00