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