discourse/app/controllers
David Taylor e7bad9f05d
FIX: Ensure directory items appear in a consistent order (#11370)
User directory items are sorted by some activity metric. If those metrics have the same value, postgres does not guarantee the order in which they will be returned. This can cause issues in pagination - some users may appear twice, and some may be missed. To illustrate

```
pry(main)> query = DirectoryItem.where(period_type: DirectoryItem.period_types[:weekly]).order(:likes_received).limit(50);
pry(main)> page1 = query.offset(0).pluck(:id);
pry(main)> page2 = query.offset(50).pluck(:id);
pry(main)> (page1 & page2).count # users on both pages
=> 29
```

If we use the primary key to tie-break matching metrics, things are much more reliable

```
pry(main)> query = DirectoryItem.where(period_type: DirectoryItem.period_types[:weekly]).order(:likes_received, :id).limit(50);
pry(main)> page1 = query.offset(0).pluck(:id);
pry(main)> page2 = query.offset(50).pluck(:id);
pry(main)> (page1 & page2).count # users on both pages
=> 0
```

This most commonly effects new sites where all the directory metrics are zero.

The fact that the ordering is indeterminate makes it difficult to write a reliable test case for this.
2020-11-27 18:12:49 +00:00
..
admin DEV: Remove 'diff local changes' when updating remote themes (#11247) 2020-11-16 19:28:12 +00:00
users FIX: Improve email validation error handling for external logins (#11307) 2020-11-23 11:06:08 +00:00
about_controller.rb Revert "Revert "Merge branch 'master' of https://github.com/discourse/discourse"" 2020-05-23 00:56:13 -04:00
application_controller.rb UX: Add group name to error message (#11333) 2020-11-24 13:06:52 +02:00
badges_controller.rb FEATURE: add noindex header to badges, groups, and /my pages (#9736) 2020-05-11 15:05:42 +10:00
bookmarks_controller.rb FEATURE: Add "delete on owner reply" bookmark functionality (#10231) 2020-07-21 10:00:39 +10:00
bootstrap_controller.rb FEATURE: Add plugin js / plugin test js to bootstrap.json 2020-11-27 12:31:17 -05:00
categories_controller.rb DEV: Improve API usage when creating * updating categories 2020-08-12 12:28:29 -06:00
clicks_controller.rb
composer_messages_controller.rb
csp_reports_controller.rb DEV: Only include "report-sample" CSP directive when reporting is enabled (#9337) 2020-04-02 11:16:38 -04:00
directory_items_controller.rb FIX: Ensure directory items appear in a consistent order (#11370) 2020-11-27 18:12:49 +00:00
draft_controller.rb FEATURE: composer option to reload page and force save draft (#10773) 2020-09-29 22:29:03 +05:30
drafts_controller.rb SECURITY: Respect topic permissions when loading draft metadata 2020-03-23 11:30:40 +00:00
email_controller.rb FIX: set mailing_list_mode to false when unsubscribing from all (#10354) 2020-08-03 16:59:54 +10:00
embed_controller.rb SECURITY: Bound the amount of work that embed#topics can do 2020-07-20 13:25:34 +01:00
exceptions_controller.rb
export_csv_controller.rb DEV: Switch to new ExportUserArchive job 2020-08-28 11:46:53 -07:00
extra_locales_controller.rb Replace base_uri with base_path (#10879) 2020-10-09 12:51:24 +01:00
finish_installation_controller.rb
forums_controller.rb DEV: shutdown_ok parameter to /srv/status 2020-03-09 14:06:13 -07:00
groups_controller.rb FEATURE: Add non_automatic group type param to groups index API 2020-10-21 09:46:45 +11:00
hashtags_controller.rb DEV: Merge category and tag hashtags code paths (#10216) 2020-07-13 19:13:17 +03:00
highlight_js_controller.rb Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076) 2020-10-30 16:05:35 +11:00
inline_onebox_controller.rb FIX: Make inline oneboxes work with secured topics in secured contexts (#8895) 2020-02-12 12:11:28 +02:00
invites_controller.rb UX: improve error message for already logged in users (#11020) 2020-10-24 21:21:01 +05:30
list_controller.rb DEV: Remove legacy tag and category routes (#10338) 2020-11-03 16:57:58 +02:00
metadata_controller.rb FIX: Include subfolder base_path in web app manifest shortcuts (#10878) 2020-10-09 11:40:40 +01:00
notifications_controller.rb FIX: Typo in NotificationsController#index not caught by tests. 2020-07-22 09:22:26 +08:00
offline_controller.rb
onebox_controller.rb DEV: Add more debugging context to onebox generation 2020-10-22 12:50:22 +08:00
permalinks_controller.rb FIX: Check for permalinks before showing the 404 page 2020-03-23 16:31:07 -07:00
post_action_users_controller.rb FEATURE: Allow category group moderators to delete topics (#11069) 2020-11-05 12:18:26 -05:00
post_actions_controller.rb
post_readers_controller.rb
posts_controller.rb FEATURE: Implement edit functionality for post notices (#11140) 2020-11-11 14:49:53 +02:00
published_pages_controller.rb FIX: Do not enable published page if secure media enabled (#11131) 2020-11-06 10:33:19 +10:00
push_notification_controller.rb
qunit_controller.rb
reviewable_claimed_topics_controller.rb FEATURE: Allow group moderators to close/archive topics 2020-07-14 12:36:19 -04:00
reviewables_controller.rb FIX: sync reviewable count when opening the hamburger menu (#10368) 2020-08-07 18:13:02 +02:00
robots_txt_controller.rb Replace base_uri with base_path (#10879) 2020-10-09 12:51:24 +01:00
safe_mode_controller.rb FEATURE: Always disable customizations on the /safe-mode route (#9052) 2020-02-28 10:53:11 +00:00
search_controller.rb FIX: global setting needs to be coerced to float (#11162) 2020-11-09 16:46:52 +11:00
session_controller.rb FIX: Improve email validation error handling for external logins (#11307) 2020-11-23 11:06:08 +00:00
similar_topics_controller.rb PERF: Avoid parsing Post#cooked with Nokogiri for every search. 2020-07-24 10:43:09 +08:00
site_controller.rb DEV: Make site setting type uploaded_image_list use upload IDs (#10401) 2020-10-13 16:17:06 +03:00
static_controller.rb Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076) 2020-10-30 16:05:35 +11:00
steps_controller.rb
stylesheets_controller.rb Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076) 2020-10-30 16:05:35 +11:00
svg_sprite_controller.rb Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076) 2020-10-30 16:05:35 +11:00
tag_groups_controller.rb Tag groups can belong to groups (#10854) 2020-10-14 13:15:54 -04:00
tags_controller.rb FIX: Ensure staff can see /tag/none (#11208) 2020-11-12 12:21:53 +11:00
theme_javascripts_controller.rb Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076) 2020-10-30 16:05:35 +11:00
topics_controller.rb UX: Add group name to error message (#11333) 2020-11-24 13:06:52 +02:00
uploads_controller.rb Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076) 2020-10-30 16:05:35 +11:00
user_actions_controller.rb
user_api_keys_controller.rb DEV: Move UserApiKey scopes to dedicated table (#10704) 2020-09-29 10:57:48 +01:00
user_avatars_controller.rb Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076) 2020-10-30 16:05:35 +11:00
user_badges_controller.rb FIX: identify slug-less topic urls everywhere 2020-06-29 12:31:20 +02:00
users_controller.rb FIX: Show better error if no bookmarks found from search (#11284) 2020-11-19 09:10:28 +10:00
users_email_controller.rb FIX: When admin changes an email for the user the user must confirm the change (#10830) 2020-10-07 13:02:24 +10:00
webhooks_controller.rb FEATURE: IMAP delete email sync for group inboxes (#10392) 2020-08-12 10:16:26 +10:00
wizard_controller.rb