discourse/plugins/chat/spec/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
..
channel_archive_service_spec.rb DEV: Don’t replace Rails logger in specs (#29721) 2024-11-13 08:47:39 +08:00
channel_fetcher_spec.rb FIX: add server-side limit for DM channels (#30300) 2024-12-16 18:36:29 +01:00
channel_hashtag_data_source_spec.rb DEV: Fix tests (#25644) 2024-02-12 14:29:23 +02:00
channel_membership_manager_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
core_pretty_text_spec.rb FIX: only allows kbd and not details 2024-04-11 00:13:58 +02:00
duplicate_message_validator_spec.rb DEV: skip flaky chat specs (#30273) 2024-12-13 17:37:40 +01:00
guardian_extensions_spec.rb DEV: Don’t provide an array to site settings group lists in specs 2024-10-17 11:25:31 +02:00
message_bookmarkable_spec.rb DEV: Don’t provide an array to site settings group lists in specs 2024-10-17 11:25:31 +02:00
message_mover_spec.rb FEATURE: Add thread support to the chat message mover (#26147) 2024-04-08 09:03:46 -03:00
message_processor_spec.rb
message_reactor_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
messages_exporter_spec.rb FIX: Chat messages exporter (#25461) 2024-01-30 18:37:11 +04:00
notifier_spec.rb DEV: Provide user input to services using params key 2024-10-25 09:57:59 +02:00
onebox_handler_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
parsed_mentions_spec.rb DEV: better highlighting of mentions (#28403) 2024-08-20 14:37:28 +02:00
post_notification_handler_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
review_queue_spec.rb DEV: Provide user input to services using params key 2024-10-25 09:57:59 +02:00
slack_compatibility_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
statistics_spec.rb DEV: Add new chat metrics (#23872) 2024-01-04 16:10:03 +04:00
transcript_service_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00