Handle Woo plugin connection timeouts without 500 errors.
Deploy Ladill Woo Manager / deploy (push) Successful in 1m4s

Treat unreachable WordPress stores as unavailable during integrations refresh instead of throwing when the site times out.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-08 11:02:06 +00:00
co-authored by Cursor
parent 09359ca86a
commit 1e97f129e9
3 changed files with 70 additions and 12 deletions
+27
View File
@@ -143,4 +143,31 @@ class WooIntegrationsTest extends TestCase
Http::assertSentCount(2);
$this->assertTrue(Cache::has('woo.integrations.'.$store->id));
}
public function test_integrations_refresh_survives_store_connection_timeout(): void
{
$user = User::factory()->create();
WooStore::create([
'user_id' => $user->id,
'site_url' => 'https://shop.example.com',
'site_name' => 'Example Shop',
'status' => WooStore::STATUS_ACTIVE,
'connected_at' => now(),
'public_id' => 'store-public-id',
]);
Http::fake([
'https://shop.example.com/wp-json/ladill-woo/v1/integrations/status' => function () {
throw new \Illuminate\Http\Client\ConnectionException(
new \Exception('cURL error 28: Operation timed out')
);
},
]);
$this->actingAs($user)
->from(route('woo.integrations.index'))
->post(route('woo.integrations.refresh'))
->assertRedirect(route('woo.integrations.index'))
->assertSessionHas('success');
}
}