fix(api): translation job IDs must not contain ':'
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

Same BullMQ 5.68 restriction as the prefetch fix (acd5691): a custom job ID
containing ':' is rejected with "Custom Id cannot contain :". enqueueTranslation
built jobId `tr:<base64>`, so every enqueue threw — and both call sites
fire-and-forget with .catch(warn), so it failed silently: fresh terms were
NX-flagged as queued but never actually enqueued, leaving new EMEX/PCAT terms
untranslated (English). Use 'tr-' prefix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-27 16:49:46 +03:00
parent acd5691f6b
commit dae76085ef

View File

@@ -290,8 +290,9 @@ export class TranslationsService {
await this.translationQueue.add(
"translate",
{ terms: chunk },
// jobId hashes the chunk so identical retries collapse
{ jobId: `tr:${Buffer.from(chunk.sort().join("|")).toString("base64").slice(0, 32)}` },
// jobId hashes the chunk so identical retries collapse.
// Prefix uses "-" not ":" — BullMQ rejects custom job IDs containing ":".
{ jobId: `tr-${Buffer.from(chunk.sort().join("|")).toString("base64").slice(0, 32)}` },
);
}
this.logger.debug(`Enqueued ${fresh.length} term(s) for async translation`);