Merge pull request #14269 from annando/reply-loop

Avoid loops when fetching replies
This commit is contained in:
Tobias Diekershoff 2024-07-03 06:30:14 +02:00 committed by GitHub
commit d93b7933d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -515,7 +515,7 @@ class Processor
}
}
if (DI::config()->get('system', 'decoupled_receiver')) {
if (DI::config()->get('system', 'decoupled_receiver') && ($activity['completion-mode'] ?? Receiver::COMPLETION_NONE != Receiver::COMPLETION_REPLIES)) {
$replies = [$item['thr-parent']];
if (!empty($item['parent-uri'])) {
$replies[] = $item['parent-uri'];
@ -1780,7 +1780,7 @@ class Processor
}
if (parse_url($id, PHP_URL_HOST) == parse_url($url, PHP_URL_HOST)) {
Logger::debug('Incluced activity will be processed', ['replies' => $url, 'id' => $id]);
self::processActivity($reply, $id, $child, '', Receiver::COMPLETION_AUTO);
self::processActivity($reply, $id, $child, '', Receiver::COMPLETION_REPLIES);
++$fetched;
continue;
}
@ -1795,7 +1795,7 @@ class Processor
Logger::debug('Activity is already queued', ['replies' => $url, 'id' => $id]);
} else {
Logger::debug('Missing Activity will be fetched and processed', ['replies' => $url, 'id' => $id]);
self::fetchMissingActivity($id, $child, '', Receiver::COMPLETION_AUTO);
self::fetchMissingActivity($id, $child, '', Receiver::COMPLETION_REPLIES);
++$fetched;
}
}

View file

@ -81,6 +81,7 @@ class Receiver
const COMPLETION_MANUAL = 3;
const COMPLETION_AUTO = 4;
const COMPLETION_ASYNC = 5;
const COMPLETION_REPLIES = 6;
/**
* Checks incoming message from the inbox