Skip to content

fix(privacy-center): avoid blank consent page when privacy experience is unavailable#8288

Open
srinath2404 wants to merge 2 commits into
ethyca:mainfrom
srinath2404:fix/consent-page-blank-when-experience-unavailable
Open

fix(privacy-center): avoid blank consent page when privacy experience is unavailable#8288
srinath2404 wants to merge 2 commits into
ethyca:mainfrom
srinath2404:fix/consent-page-blank-when-experience-unavailable

Conversation

@srinath2404

Copy link
Copy Markdown

Description Of Changes

In the Privacy Center, notice-driven consent (IS_OVERLAY_ENABLED=true) gates the entire ConsentPage body on isI18nInitialized, which is only set once a privacy experience resolves (components/ConsentPage.tsx). When an experience can't be resolved, the page renders a permanently blank <main> — no spinner, no error.

This is reachable with default settings: IS_GEOLOCATION_ENABLED defaults to false, and selectUserRegion returns undefined when geolocation is off (features/consent/consent.slice.ts), so the experience query is skipped (features/consent/hooks.ts) and experience stays undefined forever. It also covers the case where the experience request fails. (Config-driven consent initializes i18n synchronously and is unaffected.)

This PR is defensive and changes no working behavior: it surfaces a loading state while resolving, and a clear message when notice-driven consent cannot resolve an experience.

Code Changes

  • features/consent/hooks.ts: useSubscribeToPrivacyExperienceQuery now returns { isLoading }, derived from the geolocation and privacy-experience query states (additive; existing callers are unaffected).
  • components/ConsentPage.tsx: render a spinner while the experience is resolving and a fallback message when notice-driven consent has no experience, instead of an empty page. Config-driven path unchanged.

Steps to Confirm

  1. Privacy Center with IS_OVERLAY_ENABLED=true and IS_GEOLOCATION_ENABLED=false.
  2. Navigate to the consent page.
  3. Before: blank page (empty <main>, no spinner/error). After: a loading spinner, then a message that consent settings can't be loaded.
  4. Config-driven consent (IS_OVERLAY_ENABLED=false) renders the consent UI exactly as before.

Pre-Merge Checklist

  • Changelog fragment added
  • No migrations
  • No documentation updates required
  • CI pipelines succeeded
  • CLA signed

…ailable

In notice-driven mode (IS_OVERLAY_ENABLED=true), ConsentPage gated its entire
body on isI18nInitialized, which is only set once a privacy experience
resolves. When no experience could be resolved — e.g. geolocation is disabled
(the default) so no region is available, or the experience request fails — the
page rendered a permanently blank <main> with no spinner and no error.

useSubscribeToPrivacyExperienceQuery now reports a loading state. ConsentPage
shows a spinner while geolocation/experience resolve, and a clear message when
notice-driven consent cannot resolve an experience, instead of a blank page.
Config-driven consent is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Ethyca Team on Vercel.

A member of the Team first needs to authorize it.

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