Hub 2.6.0: paged lists, job status filters, one-product updates, installs found on servers
- Jobs: Succeeded/Cancelled filters, product, type and church search, paged on the server; audit log and alerts paged on the server with search; every other list paged. - Updates: one product at a time with its own releases; an Events update pins the church's Accounts (or updates it when the release needs it, or installs it first); fixes the requirement check comparing an object. - A status job adds installs found on a server and ties them to their registration; unlinked registered sites trigger one (daily); heartbeats tie install records too; the install page shows its registration. 13 new tests (209). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -224,6 +224,15 @@ router.post('/installs/heartbeat', heartbeatLimiter, async (req, res) => {
|
||||
prisma.heartbeat.create({ data: { installId: install.id, receivedAt: now, version, health: health || undefined, stats: stats || undefined } }),
|
||||
prisma.install.update({ where: { id: install.id }, data: { lastHeartbeatAt: now, version, protocolVersion: body.protocolVersion, health: health || undefined, stats: stats || undefined } }),
|
||||
]);
|
||||
// Hub 2.6.0: a site the Hub installed is tied to its registration on every heartbeat too, not
|
||||
// only when it first registers (so a missed one is mended). A site with no install record at
|
||||
// all has its server asked what's on it (a status job), which adds it. Neither fails the heartbeat.
|
||||
try {
|
||||
const tied = await prisma.deployment.updateMany({ where: { licenceId: install.licenceId, installId: null, status: { notIn: ['removed', 'failed'] } }, data: { installId: install.id } });
|
||||
if (!tied.count) await require('../utils/jobs').lookForUnlinked(install, now);
|
||||
} catch (e) {
|
||||
console.warn('[hub] tying the install record to its site failed:', e?.message || e);
|
||||
}
|
||||
if (version && install.version && version !== install.version) {
|
||||
await prisma.installEvent.create({ data: { installId: install.id, type: 'version', level: 'info', message: `Updated from ${install.version} to ${version}`, resolvedAt: now } });
|
||||
// An update the church asked for is done once the install runs a newer version.
|
||||
|
||||
Reference in New Issue
Block a user