Fix synchronous recursive fetching of deeply-nested quoted posts (#35600)
This commit is contained in:
@@ -8,9 +8,10 @@ class ActivityPub::FetchRemoteStatusService < BaseService
|
||||
DISCOVERIES_PER_REQUEST = 1000
|
||||
|
||||
# Should be called when uri has already been checked for locality
|
||||
def call(uri, prefetched_body: nil, on_behalf_of: nil, expected_actor_uri: nil, request_id: nil)
|
||||
def call(uri, prefetched_body: nil, on_behalf_of: nil, expected_actor_uri: nil, request_id: nil, depth: nil)
|
||||
return if domain_not_allowed?(uri)
|
||||
|
||||
@depth = depth || 0
|
||||
@request_id = request_id || "#{Time.now.utc.to_i}-status-#{uri}"
|
||||
@json = if prefetched_body.nil?
|
||||
fetch_status(uri, true, on_behalf_of)
|
||||
@@ -52,7 +53,7 @@ class ActivityPub::FetchRemoteStatusService < BaseService
|
||||
return nil if discoveries > DISCOVERIES_PER_REQUEST
|
||||
end
|
||||
|
||||
ActivityPub::Activity.factory(activity_json, actor, request_id: @request_id).perform
|
||||
ActivityPub::Activity.factory(activity_json, actor, request_id: @request_id, depth: @depth).perform
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user