0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 09:05:23 +08:00
discourse/plugins/chat/db/post_migrate
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
..
20260430172653_remove_duplicate_chat_mention_notifications.rb DEV: Enable some minor rubocop rules (#40094) 2026-05-19 15:29:38 +02:00
20260507083943_rebake_chat_onebox_posts.rb FIX: Chat channel onebox icons render and support channel emoji (#39826) 2026-05-11 15:17:36 +02:00
20260604052235_fix_missing_chat_dm_channel_memberships.rb FIX: Recreate missing user_chat_channel_memberships for DMs (#40560) 2026-06-04 09:09:39 +02:00