Hub 2.6.1: the Failed jobs filter and alert search no longer answer 500

The status list had timed_out, which isn't a JobStatus (the enum has
expired), and alert search used contains on the EventLevel enum: Postgres
refused both queries. JOB_STATUSES now matches the enum (tested against
schema.prisma); Failed = failed,expired; unknown products refused; level
matched by name. All list queries checked on Postgres.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 21:58:28 +02:00
co-authored by Claude Opus 5.5
parent 22d78ac81c
commit 3893fb91e0
9 changed files with 39 additions and 10 deletions
+2 -1
View File
@@ -297,7 +297,8 @@ router.get('/events', wrap(async (req, res) => {
if (term) {
and.push({ OR: [
{ message: { contains: term, mode: 'insensitive' } },
{ level: { contains: term, mode: 'insensitive' } },
// `level` is an enum, which can't be searched as text: the levels whose name matches.
...(['info', 'warning', 'critical'].filter(l => l.includes(term.toLowerCase())).length ? [{ level: { in: ['info', 'warning', 'critical'].filter(l => l.includes(term.toLowerCase())) } }] : []),
{ install: { name: { contains: term, mode: 'insensitive' } } },
{ install: { url: { contains: term, mode: 'insensitive' } } },
] });