discourse/plugins/chat
Régis Hanol 062e4fb4f3
FIX: add server-side limit for DM channels (#30300)
When fetching DM channels, we would fetch all the user's DM channels,
and limit the number of DM channels we display on the client-side using
the `DIRECT_MESSAGE_CHANNELS_LIMIT`.

This is obviously not scalable as users are having more and more
discussions with other users.

This commit ensures we always limit the number of DM channels we send to the
client.

It adds the `MAX_DM_CHANNEL_RESULTS` in `ChannelFetcher` and use it to
limit the records returned by the server. This value should always be
lower than `DIRECT_MESSAGE_CHANNELS_LIMIT` on the client-side, so that
when the user has more "unread DMs" they still show up on the client as
they read them.

While adding a spec, I also updated the spec that ensures we have a
limit on public channels to use `stub_const` to temporarily lower the number
of fixtures we create during the test.
2024-12-16 18:36:29 +01:00
..
admin/assets/javascripts UX: Hide admin header for edit/new webhook (#30194) 2024-12-12 10:49:17 +11:00
app DEV: Unify params access in services 2024-12-13 11:13:18 +01:00
assets DEV: removes sidebar-extensions css (#30266) 2024-12-13 15:36:30 +01:00
config UX: Rename private to personal messages in the interface (#29679) 2024-12-12 11:44:19 +11:00
db DEV: Make sure chat migration is in plugin directory (#29867) 2024-11-20 14:50:15 -07:00
lib FIX: add server-side limit for DM channels (#30300) 2024-12-16 18:36:29 +01:00
public
spec FIX: add server-side limit for DM channels (#30300) 2024-12-16 18:36:29 +01:00
test/javascripts DEV: Use qunit-dom's hasValue wherever possible (#30018) 2024-12-01 20:37:24 +01:00
plugin.rb DEV: Display better output when inspecting service steps 2024-12-12 15:21:10 +01:00
README.md

This plugin is still in active development and may change frequently

Documentation

The Discourse Chat plugin adds chat functionality to your Discourse so it can natively support both long-form and short-form communication needs of your online community.

For user documentation, see Discourse Chat.

For developer documentation, see Discourse Documentation.