feat(archive): wire archive converters, validation, and extension parsing into app.js/worker.js

Also fixes a third double-extension bug the plan missed: app.js derived
each job's uuid via path.basename(file.filename, path.extname(...)),
which only strips the last dot segment. For a compound extension like
tar.gz this left "<uuid>.tar" as the "uuid", overflowing the uuid
column (Char(36)) and crashing the request. Replaced with
stripExtension(). Also bumped rateLimitMaxJobs in jobs.test.js's config
override — the file's cumulative POST /api/jobs calls across all tests
now exceeds the production default (20/window) once the archive tests
are included, causing spurious connection resets independent of any
real bug.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-01 13:00:01 +02:00
co-authored by Claude Sonnet 5
parent a8cdb06d5c
commit ef6de6b583
3 changed files with 114 additions and 6 deletions
+2
View File
@@ -13,6 +13,7 @@ import { registerHeicConverter } from './converters/heic.js';
import { registerFontConverter } from './converters/font.js';
import { registerDfontConverter } from './converters/dfont.js';
import { registerEbookConverter } from './converters/ebook.js';
import { registerArchiveConverters } from './converters/archive.js';
import { findPendingJobs, markProcessing, markDone, markFailed } from './jobs/jobRepository.js';
const JOB_TIMEOUT_MS = 60000;
@@ -89,6 +90,7 @@ async function main() {
registerFontConverter();
registerDfontConverter();
registerEbookConverter();
registerArchiveConverters();
startWorker(prisma, config);
console.log(`Worker started, polling every ${config.workerPollIntervalMs}ms`);