discourse/plugins
Andrei Prigorshnev fbd24fa6ae
DEV: Allow chat mentions to have several notifications (#24874)
This PR is a reworked version of https://github.com/discourse/discourse/pull/24670.

In chat, we need the ability to have several notifications per `chat_mention`. 
Currently, we have one_to_one relationship between `chat_mentions` and `notifications`:

d7a09fb08d/plugins/chat/app/models/chat/mention.rb (L9)

We want to have one_to_many relationship. This PR implements that by introducing 
a join table between `chat_mentions` and `notifications`.

The main motivation for this is that we want to solve some performance problems 
with mentions that we're having now. Let's say a user sends a message with @ all 
in a channel with 50 members, we do two things in this case at the moment:

- create 50 chat_mentions
- create 50 notifications

We don't want to change how notifications work in core, but we want to be more 
efficient in chat, and create only 1 `chat_mention` which would link to 50 notifications. 
Also note, that on the side of notifications, having a lot of notifications is not so 
big problem, because notifications processing can be queued.

Apart from improving performance, this change will make the code design better.

Note that I've marked the old `chat_mention.notification_id` column as ignored, but 
I'm not deleting it in this PR. We'll delete it later in https://github.com/discourse/discourse/pull/24800.
2023-12-19 18:53:00 +04:00
..
chat DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
checklist Update translations (#24599) 2023-11-29 10:41:27 +01:00
discourse-details UX:; scope details change (#24715) 2023-12-05 13:56:17 +01:00
discourse-lazy-videos FIX: Add rel=0 to youtube lazy videos url (#24173) 2023-10-31 08:04:23 -03:00
discourse-local-dates DEV: Convert min_trust_to_flag_posts setting to groups (#24864) 2023-12-13 17:18:42 +08:00
discourse-narrative-bot DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
discourse-presence DEV: Convert min_trust_to_edit_wiki_post to groups (#24766) 2023-12-12 15:20:37 +11:00
footnote FEATURE: Admin plugin list redesign (#24363) 2023-11-21 09:37:11 +10:00
poll DEV: Remove usage of min_trust_to_create_topic SiteSetting (#24887) 2023-12-18 13:39:53 +11:00
spoiler-alert DEV: Fix "no-empty" lint (#24588) 2023-11-28 10:55:02 +01:00
styleguide Update translations (#24848) 2023-12-12 14:23:51 +01:00