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:
@@ -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 } });
|
||||
|
||||
Reference in New Issue
Block a user