discourse/plugins/chat/lib/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
..
schemas DEV: adds blocks support to chat messages (#29782) 2024-11-19 07:07:58 +01:00
bookmark_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
category_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
channel_archive_service.rb FEATURE: Add threads support to chat archives (#24325) 2023-11-27 15:47:35 +01:00
channel_fetcher.rb FIX: add server-side limit for DM channels (#30300) 2024-12-16 18:36:29 +01:00
channel_hashtag_data_source.rb FEATURE: Async load of category and chat hashtags (#25526) 2024-02-12 12:07:14 +02:00
channel_membership_manager.rb PERF: auto join & leave chat channels (#29193) 2024-11-12 15:00:59 +11:00
duplicate_message_validator.rb
engine.rb DEV: Update chat scheduled job loading to match skeleton (#26853) 2024-05-02 19:20:00 +01:00
group_extension.rb DEV: Redesign chat mentions (#24752) 2024-01-17 15:24:01 +04:00
guardian_extensions.rb FIX: trashed channel thread view bug (#29192) 2024-10-14 17:45:50 +04:00
mailer.rb PERF: Optimize query for finding users with unread chat messages (#29964) 2024-11-28 15:28:37 +01:00
message_blocks_validator.rb DEV: adds blocks support to chat messages (#29782) 2024-11-19 07:07:58 +01:00
message_bookmarkable.rb FIX: Show deleted bookmark reminders in user bookmarks menu (#25905) 2024-02-29 09:03:49 +10:00
message_mover.rb DEV: Provide user input to services using params key 2024-10-25 09:57:59 +02:00
message_processor.rb DEV: Rename with_secure_uploads? to should_secure_uploads? on Post (#26549) 2024-04-09 13:23:11 +10:00
message_rate_limiter.rb
message_reactor.rb
messages_exporter.rb FIX: Chat messages exporter (#25461) 2024-01-30 18:37:11 +04:00
notification_consolidation_extension.rb FEATURE: Add ability to watch chat threads (#28639) 2024-09-02 16:45:55 +04:00
notification_levels.rb FIX: Chat NotificationLevels extension breaking in prod (#21484) 2023-05-10 18:46:06 +02:00
notifier.rb FIX: delay chat notify watching job (#28386) 2024-08-15 18:08:30 +04:00
onebox_handler.rb DEV: Revert guardian changes (#24742) 2023-12-06 16:37:32 +10:00
outgoing_web_hook_extension.rb FEATURE: granular webhooks (#23070) 2023-10-09 03:35:31 +00:00
parsed_mentions.rb DEV: better highlighting of mentions (#28403) 2024-08-20 14:37:28 +02:00
plugin_instance_extension.rb
post_notification_handler.rb
review_queue.rb FIX: Create a reviewable when flagging a chat message for 'something else' (#23264) 2023-08-25 17:38:27 +08:00
reviewable_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
secure_uploads_compatibility.rb
seeder.rb PERF: auto join & leave chat channels (#29193) 2024-11-12 15:00:59 +11:00
slack_compatibility.rb
statistics.rb DEV: Add new chat metrics (#23872) 2024-01-04 16:10:03 +04:00
transcript_service.rb FIX: Do not display chat replies as threads in transcripts (#24768) 2023-12-15 09:50:43 -03:00
user_extension.rb DEV: Redesign chat mentions (#24752) 2024-01-17 15:24:01 +04:00
user_notifications_extension.rb FIX: show group based notifications in chat summary email (#27641) 2024-07-01 12:47:38 +04:00
user_option_extension.rb FEATURE: encourage users to set chat thread titles (#26617) 2024-04-29 17:20:01 +08:00