Adds real-time toast notifications to all admin pages for AI pipeline job progress. The browser subscribes to an SSE endpoint (GET /admin/pipeline/events) which polls the DB every 2 seconds and emits events whenever a job's step or status changes. - AIPipelineJob gains updatedAt (migration 20260519020000), bumped on every state-change method, with an index for efficient polling - AIPipelineJobRepositoryInterface/Doctrine get findUpdatedSince() - PipelineStreamController streams SSE with per-connection dedup and auto-reconnect (retry: 3000); streams for 90 s then signals reconnect - pipeline-notifications.js handles EventSource, shows colour-coded toasts (queued/processing/completed/failed/needs_review) and is loaded globally via DashboardController::configureAssets() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
967 B
PHP
29 lines
967 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
final class Version20260519020000 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add updated_at column to ai_pipeline_jobs for SSE change detection';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql("ALTER TABLE app.ai_pipeline_jobs ADD COLUMN updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL DEFAULT NOW()");
|
|
$this->addSql("COMMENT ON COLUMN app.ai_pipeline_jobs.updated_at IS '(DC2Type:datetime_immutable)'");
|
|
$this->addSql('CREATE INDEX idx_pipeline_jobs_updated_at ON app.ai_pipeline_jobs (updated_at)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('DROP INDEX app.idx_pipeline_jobs_updated_at');
|
|
$this->addSql('ALTER TABLE app.ai_pipeline_jobs DROP COLUMN updated_at');
|
|
}
|
|
}
|