You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/app/controllers/api/v1
Akihiko Odaki 552e886b64
Eagerly load statuses with the main query in Api::V1::FavouritesController (#14673)
The old implementation had two queries:
1. The query constructed in Api::V1::FavouritesController#results
2. The query constructed in #cached_favourites, which is merged with 1.

Both of them are issued againt PostgreSQL. The combination of the two
queries caused the following problems:
- The small window between the two queries involves race conditions.
- Minor performance inefficiency.

Moreover, the construction of query 2, which involves merging with query
1 has a bug. Query 1 is finalized with paginate_by_id, but paginate_by_id
returns an array when min_id parameter is specified. The behavior prevents
from merging the query, and in the real world, ActiveRecord simply ignores
the merge (!), which results in querying the entire scan of statuses and
favourites table.

This change fixes these issues by simply letting query 1 get all the works
done.
5 years ago
..
accounts Add user notes on accounts (#14148) 6 years ago
admin
announcements
apps
crypto Fix wrong route helper in encrypted messages controller (#13952) 6 years ago
featured_tags
instances
lists
polls Add more tests for ActivityPub controllers (#13585) 6 years ago
push Add more tests for ActivityPub controllers (#13585) 6 years ago
statuses Fix not being able to unbookmark toots when blocked by their author (#14604) 5 years ago
timelines Use Status.group instead of Status.distinct in HashQueryService (#14662) 5 years ago
accounts_controller.rb
announcements_controller.rb
apps_controller.rb
blocks_controller.rb
bookmarks_controller.rb
conversations_controller.rb
custom_emojis_controller.rb
directories_controller.rb
domain_blocks_controller.rb
endorsements_controller.rb
favourites_controller.rb Eagerly load statuses with the main query in Api::V1::FavouritesController (#14673) 5 years ago
featured_tags_controller.rb
filters_controller.rb
follow_requests_controller.rb
instances_controller.rb
lists_controller.rb
markers_controller.rb
media_controller.rb Add customizable thumbnails for audio and video attachments (#14145) 6 years ago
mutes_controller.rb
notifications_controller.rb
polls_controller.rb Add more tests for ActivityPub controllers (#13585) 6 years ago
preferences_controller.rb
reports_controller.rb
scheduled_statuses_controller.rb
statuses_controller.rb Fix/14021 behaviour on add or remove toots (#14212) 6 years ago
streaming_controller.rb
suggestions_controller.rb
trends_controller.rb