about summary refs log tree commit diff
path: root/app/services
AgeCommit message (Collapse)Author
2021-05-22Merge branch 'main' into glitch-soc/merge-upstreamClaire
2021-05-19Fix some RedisLocks auto-releasing too fast (#16276)Claire
* Fix Delete and Create-related locks expiring too fast Fixes #16238 By default, RedisLock expires after 10 seconds, which may not be enough to process statuses, especially when those have attached media files. This commit extends those 10 seconds to 15 minutes, which should be plenty enough to handle any status, while being short enough to not waste many sidekiq job retries in the exceedingly rare case in which a sidekiq process would crash when processing a `Create` or `Delete`. * Fix other RedisLock autorelease durations Fixes #15645 - things that only perform a few simple database queries (e.g. finding and saving a record) have been left unchanged, so they'll still use the default 10s duration - things that perform significantly more complex database queries have been changed to a 5 minutes timeout - things that perform multiple HTTP queries have been changed to a 15 minutes timeout
2021-05-12Merge branch 'main' into glitch-soc/merge-upstreamClaire
2021-05-11Fix to be able to redownload avatar and header (#16190)Takeshi Umeda
* Fix to reset if header and avatar download fails * Add RedownloadAvatarWorker and RedownloadHeaderWorker
2021-05-10Merge branch 'main' into glitch-soc/merge-upstreamClaire
2021-05-10Fix blocking someone not clearing up list feeds (#16205)Claire
2021-05-09Merge branch 'main' into glitch-soc/merge-upstreamClaire
2021-05-08Fix webfinger_update_due to run WebFinger on stale activitypub-account (#16182)Takeshi Umeda
2021-05-07Merge branch 'main' into glitch-soc/merge-upstreamClaire
- `app/views/statuses/_simple_status.html.haml`: Small markup change in glitch-soc, on a line that has been modified by upstream. Ported upstream changes.
2021-05-07Change trending hashtags to be affected be reblogs (#16164)Eugen Rochko
If a status with a hashtag becomes very popular, it stands to reason that the hashtag should have a chance at trending Fix no stats being recorded for hashtags that are not allowed to trend, and stop ignoring bots Remove references to hashtags in profile directory from the code and the admin UI
2021-05-07Add joined date to profiles in web UI (#16169)Eugen Rochko
2021-05-04Fix empty home feed before first follow has finished processing (#16152)Eugen Rochko
Change queue of merge worker from pull to default
2021-05-01Fix trying to fetch key from empty URI when verifying HTTP signature (#16100)Eugen Rochko
2021-04-24Change auto-following admin-selected accounts, show in recommendations (#16078)Eugen Rochko
2021-04-21Merge branch 'main' into glitch-soc/merge-upstreamClaire
2021-04-21Fix processing of remote Delete activities (#16084)Claire
* Add tests * Ensure deleted statuses are marked as such * Save some redis memory by not storing URIs in delete_upon_arrival values * Avoid possible race condition when processing incoming Deletes * Avoid potential duplicate Delete forwards * Lower lock durations to reduce issues in case of hard crash of the Rails process * Check for `lock.aquired?` and improve comment * Refactor RedisLock usage in app/lib/activitypub * Fix using incorrect or non-existent sender for relaying Deletes
2021-04-20Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `README.md`: Upstream updated copyright year, we don't mention it so kept our version. - `app/controllers/admin/dashboard_controller.rb`: Not really a conflict, upstream change (removing the spam checker) too close to glitch-soc changes. Ported upstream changes. - `app/models/form/admin_settings.rb`: Same. - `app/services/remove_status_service.rb`: Same. - `app/views/admin/settings/edit.html.haml`: Same. - `config/settings.yml`: Same. - `config/environments/production.rb`: Not a real conflict, upstream added a default HTTP header, but we have extra headers in glitch-soc. Added the header.
2021-04-17Refactor StatusReachFinder to handle followers and relays as well (#16051)Eugen Rochko
2021-04-17Fix remote reporters not receiving suspend/unsuspend activities (#16050)Eugen Rochko
2021-04-16Fix reports of already suspended accounts being recorded (#16047)Eugen Rochko
2021-04-11Remove spam check and dependency on nilsimsa gem (#16011)Eugen Rochko
2021-03-24Merge branch 'main' into glitch-soc/merge-upstreamClaire
2021-03-24Update Mastodon to Rails 6.1 (#15910)Claire
* Update devise-two-factor to unreleased fork for Rails 6 support Update tests to match new `rotp` version. * Update nsa gem to unreleased fork for Rails 6 support * Update rails to 6.1.3 and rails-i18n to 6.0 * Update to unreleased fork of pluck_each for Ruby 6 support * Run "rails app:update" * Add missing ActiveStorage config file * Use config.ssl_options instead of removed ApplicationController#force_ssl Disabled force_ssl-related tests as they do not seem to be easily testable anymore. * Fix nonce directives by removing Rails 5 specific monkey-patching * Fix fixture_file_upload deprecation warning * Fix yield-based test failing with Rails 6 * Use Rails 6's index_with when possible * Use ActiveRecord::Cache::Store#delete_multi from Rails 6 This will yield better performances when deleting an account * Disable Rails 6.1's automatic preload link headers Since Rails 6.1, ActionView adds preload links for javascript files in the Links header per default. In our case, that will bloat headers too much and potentially cause issues with reverse proxies. Furhermore, we don't need those links, as we already output them as HTML link tags. * Switch to Rails 6.0 default config * Switch to Rails 6.1 default config * Do not include autoload paths in the load path
2021-03-11Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/validators/status_length_validator.rb`: Conflict due to glitch-soc's configurable maximum toot chars. Ported upstream changes.
2021-03-04Fix URL scanning in note length validator and preview card fetching (#15827)Claire
* Add tests * Fix URL scanning in note length validator and preview card fetching
2021-03-02Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/validators/status_length_validator.rb`: Upstream changes too close to glitch-soc MAX_CHARS changes, but not a real conflict. Applied upstream changes. - `package.json`: glitch-soc-only dependency textually too close to a dependency updated upstream, not a real conflict. Applied upstream changes.
2021-03-02Update twitter-text from 1.14 to 3.1.0 and fix toot character counting (#15382)Claire
* Update twitter-text from 1.14 to 3.1.0 * Disable emoji parsing * Properly depend on twitter-text for url detection * Fix some URLs being wrongly detected client-side * Add test for server-side validation of non-autolinkable URLs * Fix server-side status length counting
2021-02-24Change ResolveAccountService's handling of skip_webfinger (#15750)Claire
* Change ResolveAccountService's handling of skip_webfinger Change it so it never makes any webfinger query, as the name would imply. * Add tests * Change FollowService to not take an URI for target_account * Restore domain-block check in FollowService * Fix tests
2021-02-12Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/javascript/styles/mastodon/modal.scss`: For some reason we changed the file loading path in glitch-soc, but now upstream has completely changed how the logo is loaded. Applied upstream changes.
2021-02-12Fix YouTube embeds failing due to YouTube serving wrong OEmbed URLs (#15716)Eugen Rochko
2021-01-26Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `CONTRIBUTING.md`: Not a real conflict, glitch-soc quotes the upstream file, which has been changed. Update the quote.
2021-01-25Fix first return value of FetchLinkCardService.html method (#15630)Takeshi Umeda
2021-01-22Use Enumerable#filter_map in more places (#15527)luigi
2021-01-22Optimize some regex matching (#15528)luigi
* Use Regex#match? * Replace =~ too * Avoid to call match? from Nil * Keep value of Regexp.last_match
2021-01-11Merge branch 'master' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/models/public_feed.rb`: Upstream refactored a bit, glitch-soc had specific code for local-only statuses. Updated glitch-soc's specific code accordingly.
2021-01-10Optimize map { ... }.compact calls (#15513)luigi
* Optimize map { ... }.compact using Enumerable#filter_map, supported since Ruby 2.7 * Add poyfill for Enumerable#filter_map
2021-01-07Fix rubocop config and warnings (#15503)abcang
* disable NewCops * update TargetRubyVersion * Fix Lint/MissingSuper for ActiveModelSerializers::Model * Fix Lint/MissingSuper for feed * Fix Lint/FloatComparison * Do not use instance variables
2021-01-06Merge branch 'master' into glitch-soc/merge-upstreamClaire
Conflicts: - `config/webpack/configuration.js`: Upstream updated the `js-yaml` dependency, which changed how to call it. Those changes conflicted because that code is pretty different in glitch-soc which has to deal with its more complex theming system. Proceeded to the same compatibility changes in glitch-soc's code. - `package.json` and `yarn.lock`: Not really a conflict, just glitch-soc-specific dependencies textually too close to some dependencies updated upstream.
2020-12-26Fix being able to import more than allowed number of follows (#15384)ThibG
* Fix being able to import more than allowed number of follows Without this commit, if someone tries importing a second list of accounts to follow before the first one has been processed, this will queue imports for the two whole lists, even if they exceed the account's allowed number of outgoing follows. This commit changes it so the individual queued imports aren't exempt from the follow limit check (they remain exempt from the rate-limiting check though). * Catch validation errors to not re-queue failed follows Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2020-12-24Fix error when changing ACL on missing objects during suspension (#15420)Eugen Rochko
2020-12-24Fix undefined method error when batch-removing statuses with ElasticSearch ↵Eugen Rochko
on (#15421)
2020-12-23Fix mentions not being deleted efficiently (#15416)ThibG
As a regression from the recent optimizations, mentions were left untouched until `account.destroy`, which would then delete them individually, and executing queries to find and delete associated notifications, resulting in a massive slowdown. Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2020-12-23Fix trying to privatize empty media attachments (#15414)Eugen Rochko
2020-12-23Merge branch 'master' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/lib/feed_manager.rb`: Not a real conflict, glitch-soc-only DM-related method too close to changed upstream stuff. Ported upstream changes. - `app/services/batched_remove_status_service.rb`: Additional logic in glitch-soc to clear DMs from timelines. Ported upstream changes and fixed the DM TL clearing logic. - `app/workers/scheduler/feed_cleanup_scheduler.rb`: Additional code in glitch-soc to clear DM timelines. Ported upstream changes.
2020-12-23Improve performances of deleting favourites when deleting accounts (#15412)ThibG
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2020-12-23Fix BatchedRemoveStatusService not working without ES in rails console (#15408)ThibG
Not a huge deal but may cause surprising failures in custom scripts and development. Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2020-12-22Improve account deletion performances further (#15407)ThibG
* Delete status records by batches of 50 * Do not precompute values that are only used once * Do not generate redis events for removal of public toots older than two weeks * Filter reported toots a priori for polls and status deletion * Do not process reblogs when cleaning up public timelines As in Mastodon proper, reblogs don't appear in public TLs * Clean the deleted account's own feed in one go * Refactor Account#clean_feed_manager and List#clean_feed_manager * Delete instead of destroy a few more associations * Fix preloading Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2020-12-22Fix batch order warnings in BatchedRemoveStatusService (#15409)ThibG
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2020-12-22Fix unnecessary queries when batch-removing statuses, 100x faster (#15387)Eugen Rochko
2020-12-21Merge branch 'master' into glitch-soc/merge-upstreamClaire