mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-20 20:55:36 +00:00
🐛 **Handle stale Livewire asset exceptions gracefully**
- ✅ Added detection logic for stale Livewire asset patterns to avoid 500 errors. - 🛠️ Updated exception handling to return 404 for stale asset requests. - 🔇 Prevented logging of stale asset exceptions to avoid unnecessary noise. - ✅ Added tests to verify 404 responses and absence of log entries for stale asset scenarios.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Livewire\Mechanisms\HandleRequests\EndpointResolver;
|
||||
|
||||
it('returns 404 for stale livewire css module urls instead of 500', function () {
|
||||
@@ -10,6 +11,19 @@ it('returns 404 for stale livewire css module urls instead of 500', function ()
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
it('does not report stale livewire css module exceptions to the logs', function () {
|
||||
Log::spy();
|
||||
|
||||
$prefix = EndpointResolver::prefix();
|
||||
|
||||
$this->get($prefix.'/css/meetups--landingpage.css?v=1502173559')
|
||||
->assertNotFound();
|
||||
|
||||
Log::shouldNotHaveReceived('error');
|
||||
Log::shouldNotHaveReceived('critical');
|
||||
Log::shouldNotHaveReceived('emergency');
|
||||
});
|
||||
|
||||
it('returns 404 for stale livewire global css module urls', function () {
|
||||
$prefix = EndpointResolver::prefix();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user