discourse/plugins/chat/app
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
..
controllers/chat FEATURE: my threads page (#24771) 2023-12-11 07:38:07 +01:00
helpers/chat FEATURE: Mark all chat channels read with a shortcut (#20629) 2023-03-22 13:24:07 +10:00
jobs DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
models DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
policies DEV: Migrate Chat::MessageCreator to a service (#22390) 2023-09-07 08:57:29 +02:00
queries/chat FEATURE: introduces group channels (#24288) 2023-11-10 11:29:28 +01:00
serializers/chat FEATURE: my threads page (#24771) 2023-12-11 07:38:07 +01:00
services DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
validators/chat DEV: properly namespace chat (#20690) 2023-03-17 14:24:38 +01:00
views FIX: correctly uses private_email site setting in chat (#24528) 2023-11-23 15:54:22 +01:00