discourse/plugins/chat/spec/lib
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
..
chat FIX: add server-side limit for DM channels (#30300) 2024-12-16 18:36:29 +01:00
chat_sdk DEV: Fix random typos (#30023) 2024-12-02 07:34:05 +08:00
site_setting_extension_spec.rb FEATURE: Allow site settings to be edited throughout admin UI (#26154) 2024-03-18 08:50:39 +10:00
statistics_spec.rb FEATURE: participating users statistics (#28322) 2024-08-12 23:47:13 +02:00