Update requests from installs (1.1.0)

POST /api/installs/update-request, signed like the heartbeat: opens an
update_requested alert and emails the alert address once; the next heartbeat
on a newer version resolves it. Shares the signature check with the heartbeat
and syncs docs/hub-protocol.md with the install's copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 13:55:03 +02:00
co-authored by Claude Opus 5.5
parent 0c0666eb40
commit 603b2046d4
8 changed files with 114 additions and 25 deletions
+2 -1
View File
@@ -88,7 +88,8 @@ async function runAlerts(now = new Date()) {
const newAlerts = [];
for (const install of installs) {
const current = problems(install, settings, now);
const openByType = new Map(install.events.filter(e => e.type !== 'registered' && e.type !== 'version').map(e => [e.type, e]));
// Update requests are opened by the install and resolved by its heartbeat, not by these checks.
const openByType = new Map(install.events.filter(e => !['registered', 'version', 'update_requested'].includes(e.type)).map(e => [e.type, e]));
for (const p of current) {
if (openByType.has(p.type)) continue;
await prisma.installEvent.create({ data: { installId: install.id, type: p.type, level: p.level, message: p.message, createdAt: now } });