fix(translation): backfill parts.description after async LLM translation
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

Worker was updating parts.name but not parts.description, so PCAT part
notices stayed raw English forever once cached. Match on raw value still
being present — once translated, the row no longer matches and we stop
touching it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 11:05:11 +03:00
parent d14bcb7dca
commit 39ad0d4c2a

View File

@@ -127,6 +127,15 @@ export async function processTranslation(
AND name_original = ${orig}
AND name = name_original
`);
// PCAT also stores the part `notice` field as `description`. We don't
// track a `description_original`, so match on the raw English value
// still being present — once translated, the row won't re-match.
await db.execute(drizzleSql`
UPDATE parts
SET description = ${tr}
WHERE source = 'parts-catalogs'
AND description = ${orig}
`);
}
// Invalidate translation lookup cache so next read sees DB value.