diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-12-04 21:23:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-04 21:23:19 +0100 |
commit | fe523a304520a09f6371f45bd63b9e8988776c03 (patch) | |
tree | 3e8d595b1cfe797db6d5f8c36425f52b82d5798a /app/services/activitypub/process_status_update_service.rb | |
parent | f4879c4481ff4fd487bc1bfb1a48aa252960b2a3 (diff) |
Fix unbounded recursion in account discovery (#1994)
* Fix trying to fetch posts from other users when fetching featured posts * Rate-limit discovery of new subdomains * Put a limit on recursively discovering new accounts
Diffstat (limited to 'app/services/activitypub/process_status_update_service.rb')
-rw-r--r-- | app/services/activitypub/process_status_update_service.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/activitypub/process_status_update_service.rb b/app/services/activitypub/process_status_update_service.rb index a0605b1a3..fad19f87f 100644 --- a/app/services/activitypub/process_status_update_service.rb +++ b/app/services/activitypub/process_status_update_service.rb @@ -5,7 +5,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService include Redisable include Lockable - def call(status, json) + def call(status, json, request_id: nil) raise ArgumentError, 'Status has unsaved changes' if status.changed? @json = json @@ -15,6 +15,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService @account = status.account @media_attachments_changed = false @poll_changed = false + @request_id = request_id # Only native types can be updated at the moment return @status if !expected_type? || already_updated_more_recently? @@ -191,7 +192,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService next if href.blank? account = ActivityPub::TagManager.instance.uri_to_resource(href, Account) - account ||= ActivityPub::FetchRemoteAccountService.new.call(href) + account ||= ActivityPub::FetchRemoteAccountService.new.call(href, request_id: @request_id) next if account.nil? |