2.2 KiB
v8 repair: stale non-A1 localized company defaults
Cause
Previous migrations kept exact snapshots from newer default versions but dropped the early v3 translated language bundle. Croatian and Bulgarian retained plain five-H2/100-word descriptions, while English retained literal five-H2 markup. If a single language or structured formula differed, a whole-category eligibility check skipped the company record. The v7 cache refresh alone could not replace these stored category entries.
Changes
- The original v3 25-language bundle is embedded only as an exact-match migration whitelist.
- The seed upgrades old whole-category defaults where safe. For mixed categories it independently upgrades only locale roles matching a released platform default, preserving unrelated custom instructions.
- Known old structured title/description JSON is upgraded independently when an exact prior default is recognized; custom formula JSON is never overwritten.
- English wildcard and 25 localizations share one SEO HTML skeleton. The localized meta title and description each have their own
{}instruction. - Only the existing Postgres connection is required. No translation models and no API key.
Deploy
Deploy API, worker and frontend as one version, then run migration + the offline seed:
npm run migrate
npm run seed:category-prompts:i18n -- -dry-run
npm run seed:category-prompts:i18n
Look for legacy_upgraded and non_a1_legacy_locales_repaired in the seed output; for the named examples, Croatian and Bulgarian will show the full HTML instructions after the seed, once the editor reloads the category. The seed does not regenerate existing processed product descriptions.
Safety
The backfill compares exact historical platform values, not keywords or fuzzy text. Company-authored sections that differ from the released defaults are kept as-is. The updates use optimistic compare-and-swap predicates against the original row values. If an intentionally edited company prompt remains different, it will be left untouched.
Verification
Frontend locale tests and Go source syntax checks are available here. Running the complete API suite requires Go 1.25 and a configured PostgreSQL test environment.