fix(privacy-center): avoid blank consent page when privacy experience is unavailable#8288
Open
srinath2404 wants to merge 2 commits into
Open
Conversation
…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>
Contributor
|
Someone is attempting to deploy a commit to the Ethyca Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description Of Changes
In the Privacy Center, notice-driven consent (
IS_OVERLAY_ENABLED=true) gates the entireConsentPagebody onisI18nInitialized, 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_ENABLEDdefaults tofalse, andselectUserRegionreturnsundefinedwhen geolocation is off (features/consent/consent.slice.ts), so the experience query is skipped (features/consent/hooks.ts) andexperiencestaysundefinedforever. 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:useSubscribeToPrivacyExperienceQuerynow 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
IS_OVERLAY_ENABLED=trueandIS_GEOLOCATION_ENABLED=false.<main>, no spinner/error). After: a loading spinner, then a message that consent settings can't be loaded.IS_OVERLAY_ENABLED=false) renders the consent UI exactly as before.Pre-Merge Checklist