- Logger::info('Delivery failed', ['retcode' => $response->getReturnCode(), 'serverfailure' => $serverfail, 'runtime' => round($runtime, 3), 'uri-id' => $uri_id, 'uid' => $uid, 'item_id' => $item_id, 'cmd' => $cmd, 'inbox' => $inbox]);
+ // Resubscribe to relay server upon client error
+ if (!$serverfail && ($response->getReturnCode() >= 400) && ($response->getReturnCode() <= 499)) {
+ $actor = self:: fetchActorForRelayInbox($inbox);
+ if (!empty($actor)) {
+ $drop = !ActivityPub\Transmitter::sendRelayFollow($actor);
+ Logger::notice('Resubscribed to relay', ['url' => $actor, 'success' => !$drop]);
+ } elseif ($cmd = WorkerDelivery::DELETION) {
+ // Remote systems not always accept our deletion requests, so we drop them if rejected.
+ // Situation is: In Friendica we allow the thread owner to delete foreign comments to their thread.
+ // Most AP systems don't allow this, so they will reject the deletion request.
+ $drop = true;
+ }
+
+ }
+
+ Logger::info('Delivery failed', ['retcode' => $response->getReturnCode(), 'serverfailure' => $serverfail, 'drop' => $drop, 'runtime' => round($runtime, 3), 'uri-id' => $uri_id, 'uid' => $uid, 'item_id' => $item_id, 'cmd' => $cmd, 'inbox' => $inbox]);