Skip to content

fix(LLMO-4058): use type 'base' instead of 'url' in brand_sites writes [PROD REGRESSION]#2200

Closed
irenelagno wants to merge 3 commits intomainfrom
fix/brand-sites-type-url-to-base
Closed

fix(LLMO-4058): use type 'base' instead of 'url' in brand_sites writes [PROD REGRESSION]#2200
irenelagno wants to merge 3 commits intomainfrom
fix/brand-sites-type-url-to-base

Conversation

@irenelagno
Copy link
Copy Markdown
Contributor

@irenelagno irenelagno commented Apr 13, 2026

⚠️ Prod regression — broken since April 9

PR #2149 (merged 2026-04-09) added brand_sites_type_check which only allows 'base' and 'localized'. All brand URL callsites still passed type: 'url', causing upsertBrand to throw a constraint violation on every v2 onboarding since April 9.

The error is silently caught as a WARN, so onboarding completes — but no brand row exists in PostgREST. Downstream effect: spacecat-audit-worker can't resolve brandId → DRS brand-presence scheduler returns 422 for all affected sites.

Affected on prod: any org with brandalf=true feature flag that triggered an onboarding after April 9.

What changed

4 callsites changed type: 'url'type: 'base':

File Location
src/controllers/llmo/llmo-onboarding.js buildInitialCustomerConfigV2 (brand update path)
src/controllers/llmo/llmo-onboarding.js ensureInitialCustomerConfigV2 (add-brand path)
src/controllers/llmo/llmo-onboarding.js performLlmoOnboarding (v2 upsertBrand call)
src/support/customer-config-mapper.js convertV1ToV2

Test plan

  • Run unit tests: npm test (4 previously-failing assertions now updated)
  • Re-onboard a v2 site and verify brand row appears in PostgREST brands + brand_sites with type = 'base'
  • Verify DRS brand-presence scheduler no longer returns 422 after onboarding

🤖 Generated with Claude Code

The brand_sites_type_check constraint (added in #2149) only allows
'base' and 'localized'. All brand URL callsites were still passing
type: 'url', causing upsertBrand to fail silently and leaving v2
onboarded sites without an active brand — which in turn caused the
DRS brand-presence scheduler to 422.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@irenelagno
Copy link
Copy Markdown
Contributor Author

Fix cherry-picked into PR #2171 — closing this duplicate.

@irenelagno irenelagno closed this Apr 13, 2026
@irenelagno irenelagno reopened this Apr 13, 2026
…s URLs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

This PR will trigger a patch release when merged.

@irenelagno irenelagno changed the title fix(LLMO-4058): use type 'base' instead of 'url' in brand_sites writes fix(LLMO-4058): use type 'base' instead of 'url' in brand_sites writes [PROD REGRESSION] Apr 13, 2026
@irenelagno irenelagno closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant