Feat(mercure): broadcast output and finishedAt in trace events for real-time logs
testing/ogcore-api/pipeline/head There was a failure building this commit Details
ogcore-debian-package/pipeline/head This commit looks good Details

pull/125/head
Juan Manuel Bardallo 2026-07-30 11:10:42 +02:00
parent bca1f4392f
commit c29af77466
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,9 @@
## [1.9.2] - 2026-07-23
### Added
- Mercure (`TraceStatusProgressNotifier`): Publish `output` and `finishedAt` fields in Mercure traces event for real-time log updates without page reload.
### Fixed
- Menú del navegador (`main.html.twig`): Modificada la acción por defecto para el arranque de sistemas operativos. Se ha cambiado de `command+output:` a `command:` para evitar que se abra la ventana emergente de salida de comandos, ofreciendo una experiencia de arranque más limpia.
- Webhook (`StatusController` y `RunScriptAction`): Solucionado el problema de condición de carrera que creaba trazas duplicadas al ejecutar scripts. Ahora se establece el estado a `IN_PROGRESS` de forma síncrona en `RunScriptAction` al enviar el script a clientes Windows/Linux, prescindiendo del problemático webhook asíncrono `START_SCRIPT`.

View File

@ -47,6 +47,7 @@ class TraceStatusProgressNotifier
'status' => $trace->getStatus(),
'progress' => $trace->getProgress(),
'finishedAt' => $trace->getFinishedAt()?->format(\DateTimeInterface::ATOM),
'output' => $trace->getOutput()
])
);
$this->hub->publish($update);
@ -55,6 +56,8 @@ class TraceStatusProgressNotifier
'client' => $trace->getUuid(),
'status' => $trace->getStatus(),
'progress' => $trace->getProgress(),
'finishedAt' => $trace->getFinishedAt()?->format(\DateTimeInterface::ATOM),
'output' => $trace->getOutput() ? substr($trace->getOutput(), 0, 200) . '...' : null,
]);
}
}