discourse/plugins/chat/spec
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
..
components/chat FEATURE: add grace period for chat edits (#23800) 2023-10-23 16:40:30 +08:00
fabricators FEATURE: my threads page (#24771) 2023-12-11 07:38:07 +01:00
integration DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
jobs DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
lib FIX: Do not display chat replies as threads in transcripts (#24768) 2023-12-15 09:50:43 -03:00
mailers 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/chat/channel DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
queries/chat DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
requests DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
serializer DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
services DEV: Allow chat mentions to have several notifications (#24874) 2023-12-19 18:53:00 +04:00
support DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
system DEV: skip two flakey specs (#24965) 2023-12-19 09:27:09 +01:00
validators COPY: secure media -> secure uploads (#24643) 2023-11-30 14:58:55 +10:00
plugin_helper.rb FEATURE: implements drafts for threads (#24483) 2023-11-22 11:54:23 +01:00
plugin_spec.rb COPY: secure media -> secure uploads (#24643) 2023-11-30 14:58:55 +10:00