discourse/plugins/chat/spec
Martin Brennan 24ec06ff85
FEATURE: Reintroduce better thread reply counter cache (#21197)
This was reverted in 38cebd3ed5.
The issue was that I was using Discourse.redis.delete_prefixed
which does a slow redis KEYS lookup, which is not advised in
production. This commit removes that, and also ensures the periodical
thread count update only happens if threading is enabled.

I changed to use a redis INCR/DECR for reply count
cache. This avoids a round trip to redis to GET the current
count, and also avoids multi-process issues, where
if there's two processes trying to increment at the
same time, they may both receive the same value, add one
to it, then both write the same value back.
Then, it's only n+1 instead of n+2.

This also prevents almost all chat scheduled jobs from
running if chat is disabled, the only one remaining is
the message retention job.
2023-04-24 09:32:04 +10:00
..
components/chat DEV: more tests for mentions when updating chat messages (#21185) 2023-04-21 16:58:01 +04:00
fabricators DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
integration FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
jobs FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
lib FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
mailers DEV: Skip channel-wide mention chat specs (#20770) 2023-03-22 12:44:01 +10:00
models FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
queries/chat FIX: Do not count thread messages for channel unreads (#21126) 2023-04-19 08:53:51 +10:00
requests FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
serializer FIX: Do not serialize thread data if threading disabled (#21107) 2023-04-17 14:29:06 +10:00
services FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
support DEV: Move channel creation for category into service (#21167) 2023-04-24 09:15:16 +10:00
system FIX: Chat composer shortcuts should respect context (#21130) 2023-04-19 09:07:52 +10:00
validators DEV: properly namespace chat (#20690) 2023-03-17 14:24:38 +01:00
plugin_helper.rb FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
plugin_spec.rb UX: update chat icon to d-chat (#20744) 2023-03-21 10:40:42 -04:00