Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(logs): keep stream polling active without collapsible panel

Andras Bacsai182df1cb0793
diff --git a/resources/views/livewire/project/shared/get-logs.blade.php b/resources/views/livewire/project/shared/get-logs.blade.php
index 4ef77081e7..230a2c22ae 100644
--- a/resources/views/livewire/project/shared/get-logs.blade.php
+++ b/resources/views/livewire/project/shared/get-logs.blade.php
@@ -274,10 +274,13 @@
<div>({{ $pull_request }})</div>
@endif
@if ($streamLogs)
- <x-loading wire:poll.2000ms='getLogs(true)' />
+ <x-loading />
@endif
</div>
@endif
+ @if ($streamLogs)
+ <div class="sr-only" wire:poll.2000ms="getLogs(true)" aria-hidden="true"></div>
+ @endif
<div x-show="expanded" {{ $collapsible ? 'x-collapse' : '' }}
:class="fullscreen ? 'fullscreen flex flex-col !overflow-visible' : 'relative w-full {{ $collapsible ? 'py-4' : '' }} mx-auto'"
:style="fullscreen ? 'max-height: none !important; height: 100% !important;' : ''">
diff --git a/tests/Feature/GetLogsCommandInjectionTest.php b/tests/Feature/GetLogsCommandInjectionTest.php
index c0b17c3bd7..db75f7b757 100644
--- a/tests/Feature/GetLogsCommandInjectionTest.php
+++ b/tests/Feature/GetLogsCommandInjectionTest.php
@@ -130,6 +130,20 @@ describe('GetLogs Livewire action validation', function () {
});
});
+describe('GetLogs stream polling', function () {
+ test('streaming logs polls when log panel is not collapsible', function () {
+ Livewire::test(GetLogs::class, [
+ 'server' => $this->server,
+ 'resource' => $this->application,
+ 'container' => 'coolify-sentinel',
+ 'collapsible' => false,
+ ])
+ ->assertDontSeeHtml('wire:poll.2000ms="getLogs(true)"')
+ ->call('toggleStreamLogs')
+ ->assertSeeHtml('wire:poll.2000ms="getLogs(true)"');
+ });
+});
+
describe('GetLogs container name injection payloads are blocked by validation', function () {
test('newline injection payload is rejected', function () {
// The exact PoC payload from the advisory