Commit Graph

39 Commits (i18n/crowdin/translations)

Author SHA1 Message Date
Claire 598ae4f2da
Add endpoints for unread notifications count (#31191) 5 months ago
Matt Jankowski 65e82211cd
Rename `cache_*` methods to `preload_*` in controller concern (#30209) 8 months ago
Matt Jankowski b5115850bb
Move repeated `insert_pagination_headers` method to api base class (#29606) 9 months ago
Matt Jankowski 9754967d5f
Move `pagination_max_id` and `pagination_since_id` into api/base controller (#28844) 10 months ago
Eugen Rochko 50b17f7e10
Add notification policies and notification requests (#29366) 10 months ago
Eugen Rochko fdc3ff7c2d
Change notifications API to use a replica (#25874) 1 year ago
Nick Schonning 434770f580
Autofix Rubocop Rails/FindById (#23762) 2 years ago
Nick Schonning e2a3ebb271
Autofix Rubocop Style/IfUnlessModifier (#23697) 2 years ago
Eugen Rochko 21780c0204
Change notifications per page from 15 to 40 in REST API (#23348) 2 years ago
nametoolong 63b379c2d9
Fix N+1 queries from in NotificationsController (#21202)
Co-authored-by: Nonexistent <nx@example.org>
2 years ago
Eugen Rochko e6ffbfb5e7
Add `types` param to `GET /api/v1/notifications` in REST API (#17767)
* Add `types` param to `GET /api/v1/notifications` in REST API

* Improve tests
3 years ago
abcang 7ab53f221a
Improved performance of notification preloading (#15640)
* Improved performance of notification preloading

* Remove Cacheable from Notification

* Fix test
4 years ago
Eugen Rochko e6b272e5c9
Change REST API to return empty data for suspended accounts (#14765) 4 years ago
Akihiko Odaki 64ef37b89d
Introduce ApplicationController#cache_collection_paginated_by_id (#14677)
* Replace incorrect use of distinct with group

Some uses of ActiveRecord::QueryMethods#distinct pass field names but they
are incorrect for the current version of Rails.

ActiveRecord::QueryMethods#group provides the expected behavior and
benefits performance. See commit 6da24aad4c.

* Introduce ApplicationController#cache_collection_paginated_by_id

ApplicationController#cache_collection_paginated_by_id fuses
ApplicationController#cache_collection and Paginable.paginate_by_id.

An advantage of this method is that it prevents from modifying scope which
Paginable.paginate_by_id may provide.
ApplicationController#cache_collection always return an array and there
is no possibility of the scope modification. It is also clear for a
programmer, considering the implication of "cache".

This method can also emit more efficient queries by using
Cacheable.cache_ids before calling Paginable.paginate_by_id.
4 years ago
Eugen Rochko 0ae5c6312f
Remove useless `respond_to` calls (#13208) 5 years ago
Paul Woolcock 0c933c1b8c Add `account_id` param to `GET /api/v1/notifications` (#10796)
* Add `from_account` to notifications API

this adds the ability to filter notifications by the account they
originated from

* passing a non-existent user should cause none to be returned

* Fix codeclimate warnings

* fix more codeclimate warnings

* make requested changes:

* use account id instead of user@domain
* name the param `account_id` instead of `from_account`

* Don't use `return` in a lambda
6 years ago
Eugen Rochko f0fff3eb10
Support min_id-based pagination in REST API (#8736)
* Allow min_id pagination in Feed#get

* Add min_id pagination to home and list timeline APIs

* Add min_id pagination to account statuses, public and tag APIs

* Remove unused stub in reports API

* Use min_id pagination in notifications, favourites, and fix order

* Fix HomeFeed#from_database not using paginate_by_id
6 years ago
Eugen Rochko 1f6ed4f86a
Add more granular OAuth scopes (#7929)
* Add more granular OAuth scopes

* Add human-readable descriptions of the new scopes

* Ensure new scopes look good on the app UI

* Add tests

* Group scopes in screen and color-code dangerous ones

* Fix wrong extra scope
7 years ago
Eugen Rochko 33513753b9
Fix unpermitted parameters warning when generating pagination URLs (#6995) 7 years ago
Eugen Rochko 8b2cad5637 Refactor JSON templates to be generated with ActiveModelSerializers instead of Rabl (#4090) 8 years ago
Yamagishi Kazutoshi 0a0b9a271a Improve RuboCop rules (compatibility to Code Climate) (#3636)
08f8de84eb/Gemfile.lock (L38)
Code Climate is using RuboCop v0.46.0.

Change several rules to maintain compatibility.
8 years ago
Matt Jankowski 73540ffe6b Clean up for api/base controller (#3629)
* Move ApiController to Api/BaseController

* API controllers inherit from Api::BaseController

* Add coverage for various error cases in api/base controller
8 years ago
Matt Jankowski 9c7505489f Refactor api/v1/notifications controller (#3470) 8 years ago
Ashley 05ac28f3e4 Added API for single notification dismissal (#2251)
* Added API backend for notification dismissal

* Added render statement

* Changed statement
8 years ago
Eugen 2810013b93 API param to exclude notification types from response (#1341)
* Add exclude_types param to /api/v1/notifications

* Exclude notification types in web UI through exclude_types in the API
8 years ago
Eugen b89f007862 Make public timelines API not require user context/app credentials (#1291)
* Make /api/v1/timelines/public and /api/v1/timelines/tag/:id public
Fix #1156 - respect query params when generating pagination links in API

* Apply pagination fix to more APIs
8 years ago
Eugen Rochko de22c202f5 Add counter caches for a large performance increase on API requests 8 years ago
Eugen Rochko 3e9d794ea5 Add tuning documentation, add <content> tags back to most salmons,
make status pagination headers generation more lax about next page
existing
8 years ago
Eugen Rochko 905c829179 Improve infinite scroll on notifications 8 years ago
Eugen Rochko 1f5792c834 API now respects ?limit param as long as it's within 2x default limit 8 years ago
Eugen Rochko f392030ab8 Add /api/v1/notifications/clear, non-existing link cards for statuses will
now return empty hash instead of throwing a 404 error. When following,
merge into timeline will filter statuses
8 years ago
Eugen Rochko 3a4b5961be Method to fetch a single notification 8 years ago
Eugen Rochko 2146ac91a0 Follow requests send e-mail notifications, but are excluded from notifications API
Better initial state for unlisted/nsfw toggles
8 years ago
Eugen Rochko 7e90772c92 Unify collection caching code 8 years ago
Eugen Rochko 8a3745a4df Remove stale entries from cache results 8 years ago
Eugen Rochko 4bdb6a0eaf Rename "publish" to "toot" in english locale, fix lightbox showing old image
before loading new one, cache notifications API, fix missing follow button
on public profiles
8 years ago
Eugen Rochko f88ca4a206 Performance improvement for notifications API 8 years ago
Eugen Rochko 52119104b9 Remove some n+1 queries from notifications API 8 years ago
Eugen Rochko da2ef4d676 Adding unified streamable notifications 8 years ago