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:
@@ -671,3 +671,14 @@ describe('the jobs list: every status, product, search and pages (2.6.0)', () =>
|
||||
expect(pageOf({ pageSize: '100000' }).pageSize).toBe(200);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the jobs list only asks for statuses the database knows (2.6.1)', () => {
|
||||
test('JOB_STATUSES is exactly the JobStatus enum, and an old page\'s "timed_out" is dropped', async () => {
|
||||
const schema = require('fs').readFileSync(require('path').join(__dirname, '..', 'prisma', 'schema.prisma'), 'utf8');
|
||||
const block = /enum JobStatus \{([\s\S]*?)\}/.exec(schema)[1];
|
||||
const values = block.split(/\r?\n/).map(l => l.replace(/\/\/.*$/, '').trim()).filter(Boolean);
|
||||
expect([...jobs.JOB_STATUSES].sort()).toEqual([...values].sort());
|
||||
expect(await jobs.listWhere({ status: 'failed,timed_out' })).toEqual({ AND: [{ status: { in: ['failed'] } }] });
|
||||
expect(await jobs.listWhere({ status: 'failed,expired' })).toEqual({ AND: [{ status: { in: ['failed', 'expired'] } }] });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user