mirror of
https://github.com/discourse/discourse.git
synced 2024-12-24 12:36:27 +08:00
062e4fb4f3
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. |
||
---|---|---|
.. | ||
schemas | ||
bookmark_extension.rb | ||
category_extension.rb | ||
channel_archive_service.rb | ||
channel_fetcher.rb | ||
channel_hashtag_data_source.rb | ||
channel_membership_manager.rb | ||
duplicate_message_validator.rb | ||
engine.rb | ||
group_extension.rb | ||
guardian_extensions.rb | ||
mailer.rb | ||
message_blocks_validator.rb | ||
message_bookmarkable.rb | ||
message_mover.rb | ||
message_processor.rb | ||
message_rate_limiter.rb | ||
message_reactor.rb | ||
messages_exporter.rb | ||
notification_consolidation_extension.rb | ||
notification_levels.rb | ||
notifier.rb | ||
onebox_handler.rb | ||
outgoing_web_hook_extension.rb | ||
parsed_mentions.rb | ||
plugin_instance_extension.rb | ||
post_notification_handler.rb | ||
review_queue.rb | ||
reviewable_extension.rb | ||
secure_uploads_compatibility.rb | ||
seeder.rb | ||
slack_compatibility.rb | ||
statistics.rb | ||
transcript_service.rb | ||
user_extension.rb | ||
user_notifications_extension.rb | ||
user_option_extension.rb |