feat(web): push live updates to the dashboard

Reading a page and wondering whether it is still true is a poor way to watch
a deployment, and polling every page on a timer costs far more than it
returns.

The server keeps one `text/event-stream` per open tab and publishes on it:
a write once it has actually succeeded, tagged with the page it concerns, a
deployment when it starts and when it ends, an incoming Gitea webhook, plus
a tick and a heartbeat that stops proxies closing an idle stream.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
nocodeandClaude Opus 5 committed 2026-09-23 20:39:59 +02:00
1 parent 9c6297e00e
commit df89cc5893
6 files changed
+351 -1

No files matched your search

+3
View File
@@ -5,6 +5,7 @@ import { getDatabase } from '../database/index.js';
import { logEvent } from '../database/repositories/event-log-repository.js';
import { buildGiteaNotification } from '../services/notifications/gitea-notifications.js';
import { notify } from '../services/notifications/notification-service.js';
import { broadcast } from '../web/events.js';
const log = createLogger('webhooks');
@@ -60,6 +61,8 @@ export async function handleGiteaWebhook(client, headers, rawBody) {
payload: { deliveryId, type: notification.type },
});
broadcast('gitea', { event, repository: payload.repository?.full_name ?? null });
await notify(client, notification.type, {
embeds: [notification.embed],
content: payload.repository?.full_name ? `**${payload.repository.full_name}**` : undefined,