diff --git a/composer.lock b/composer.lock index c5c83d6e4..c94bb296a 100644 --- a/composer.lock +++ b/composer.lock @@ -16516,16 +16516,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.2", + "version": "11.5.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "153d0531b9f7e883c5053160cad6dd5ac28140b3" + "reference": "30e319e578a7b5da3543073e30002bf82042f701" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/153d0531b9f7e883c5053160cad6dd5ac28140b3", - "reference": "153d0531b9f7e883c5053160cad6dd5ac28140b3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/30e319e578a7b5da3543073e30002bf82042f701", + "reference": "30e319e578a7b5da3543073e30002bf82042f701", "shasum": "" }, "require": { @@ -16546,7 +16546,7 @@ "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", "sebastian/code-unit": "^3.0.2", - "sebastian/comparator": "^6.2.1", + "sebastian/comparator": "^6.3.0", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.0", "sebastian/exporter": "^6.3.0", @@ -16597,7 +16597,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.3" }, "funding": [ { @@ -16613,7 +16613,7 @@ "type": "tidelift" } ], - "time": "2024-12-21T05:51:08+00:00" + "time": "2025-01-13T09:36:00+00:00" }, { "name": "sebastian/cli-parser", @@ -18111,7 +18111,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { @@ -18127,6 +18127,6 @@ "ext-openssl": "*", "ext-redis": "*" }, - "platform-dev": {}, - "plugin-api-version": "2.6.0" + "platform-dev": [], + "plugin-api-version": "2.3.0" } diff --git a/src/MessageHandler/ActivityPub/Inbox/ActivityHandler.php b/src/MessageHandler/ActivityPub/Inbox/ActivityHandler.php index 3ca978e38..bb12637b3 100644 --- a/src/MessageHandler/ActivityPub/Inbox/ActivityHandler.php +++ b/src/MessageHandler/ActivityPub/Inbox/ActivityHandler.php @@ -67,8 +67,10 @@ public function doWork(MessageInterface $message): void $payload = @json_decode($message->payload, true); if (null === $payload) { - $this->logger->warning('[ActivityHandler::doWork] Activity message from was empty: {json}, ignoring it', ['json' => json_encode($message->payload)]); - throw new UnrecoverableMessageHandlingException('activity message from was empty'); + $this->logger->warning('[ActivityHandler::doWork] Activity message from was empty or invalid JSON. Truncated content: {content}, ignoring it', [ + 'content' => substr($message->payload ?? 'No payload provided', 0, 200), + ]); + throw new UnrecoverableMessageHandlingException('Activity message from was empty or invalid JSON'); } if ($message->request && $message->headers) { @@ -93,7 +95,7 @@ public function doWork(MessageInterface $message): void if (null === $payload['id']) { $this->logger->warning('[ActivityHandler::doWork] Activity message has no id field which is required: {json}', ['json' => json_encode($message->payload)]); - throw new UnrecoverableMessageHandlingException('activity message has no id field'); + throw new UnrecoverableMessageHandlingException('Activity message has no id field'); } $idHost = parse_url($payload['id'], PHP_URL_HOST);