From 409c6f013902ad21cabbd2afc18abb1ad8b52077 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sat, 13 Jun 2026 18:19:04 -0300 Subject: [PATCH] Drop the resolution warning log and fake createRecord via config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the final Log::warning (and the lastError/lastEndpoint tracking that only fed it) — the per-endpoint debug log already covers diagnosis. Fake the createRecord endpoint from config('trypost.platforms.bluesky.default_service') in the new tests instead of hardcoding the host. --- app/Services/Social/BlueskyPublisher.php | 13 ------------- .../Services/Social/BlueskyPublisherTest.php | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/app/Services/Social/BlueskyPublisher.php b/app/Services/Social/BlueskyPublisher.php index 31eaff47..dda56f9a 100644 --- a/app/Services/Social/BlueskyPublisher.php +++ b/app/Services/Social/BlueskyPublisher.php @@ -284,8 +284,6 @@ private function resolveHandleToDid(string $handle, ?string $service = null, ?So config('trypost.platforms.bluesky.default_service'), ]))); - $lastError = null; - $lastEndpoint = null; foreach ($endpoints as $endpoint) { try { $request = $this->socialHttp(); @@ -303,11 +301,6 @@ private function resolveHandleToDid(string $handle, ?string $service = null, ?So return $did; } } catch (Throwable $e) { - // Per-endpoint failures are expected during transient outages; - // keep them at debug to avoid noisy logs and surface a single - // warning below only when every endpoint has been exhausted. - $lastError = $e->getMessage(); - $lastEndpoint = $endpoint; Log::debug('Bluesky handle resolution attempt failed', [ 'handle' => $handle, 'endpoint' => $endpoint, @@ -316,12 +309,6 @@ private function resolveHandleToDid(string $handle, ?string $service = null, ?So } } - Log::warning('Bluesky handle resolution failed; mention will be sent as plain text', [ - 'handle' => $handle, - 'endpoint' => $lastEndpoint, - 'error' => $lastError, - ]); - return null; } diff --git a/tests/Feature/Services/Social/BlueskyPublisherTest.php b/tests/Feature/Services/Social/BlueskyPublisherTest.php index 6ce6df4a..0c38df33 100644 --- a/tests/Feature/Services/Social/BlueskyPublisherTest.php +++ b/tests/Feature/Services/Social/BlueskyPublisherTest.php @@ -111,7 +111,7 @@ '*/xrpc/com.atproto.identity.resolveHandle*' => Http::response([ 'did' => 'did:plc:friend456', ], 200), - 'https://bsky.social/xrpc/com.atproto.repo.createRecord' => Http::response([ + config('trypost.platforms.bluesky.default_service').'/xrpc/com.atproto.repo.createRecord' => Http::response([ 'uri' => 'at://did:plc:testuser123/app.bsky.feed.post/3abc123xyz', 'cid' => 'bafyreiabc123', ], 200), @@ -143,7 +143,7 @@ Http::fake([ '*/xrpc/com.atproto.identity.resolveHandle*' => Http::response(['error' => 'InvalidRequest'], 400), - 'https://bsky.social/xrpc/com.atproto.repo.createRecord' => Http::response([ + config('trypost.platforms.bluesky.default_service').'/xrpc/com.atproto.repo.createRecord' => Http::response([ 'uri' => 'at://did:plc:testuser123/app.bsky.feed.post/3abc123xyz', 'cid' => 'bafyreiabc123', ], 200),