ENG-3648: Fix FidesJS banner resurfacing on non-applicable notices#8137
Open
gilluminate wants to merge 8 commits intomainfrom
Open
ENG-3648: Fix FidesJS banner resurfacing on non-applicable notices#8137gilluminate wants to merge 8 commits intomainfrom
gilluminate wants to merge 8 commits intomainfrom
Conversation
shouldResurfaceBanner treated a notice as missing prior consent whenever it was absent from savedConsent, even if the notice was already recorded as non-applicable in the saved cookie. When such a notice later became applicable in a different experience, the banner resurfaced on every page load after dismissal until the user actually saved preferences. Treat notices listed in cookie.non_applicable_notice_keys as having a known prior decision, alongside notices with explicit consent values.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
shouldResurfaceBanner reads cookie.non_applicable_notice_keys, but updateCookieFromExperience overwrote that field with the current experience's list before the resurface check ran. When a notice that was non-applicable in a prior region became applicable in the current one, the saved record was erased and the banner kept resurfacing despite the previous fix. Union the saved list with the current experience's non-applicable list so the resurface check sees both. Update the existing test to match and add a deduplication case.
…ence load" This reverts commit 6e7a7bd.
…tices" This reverts commit fa5808b.
handleDismiss skipped handleUpdatePreferences whenever the saved cookie had any consent values set. When a notice that was previously non-applicable became applicable in a new region, the saved cookie already had values for the prior notices but no entry for the new one, so dismiss became a no-op and the banner kept resurfacing on every reload until the user explicitly saved preferences. Tighten the guard: only skip dismiss-update when every currently- applicable notice already has a recorded preference. If any served notice is missing from the saved consent map, dismiss now records defaults for it (preserving existing decisions).
gilluminate
commented
May 8, 2026
| selectBestNoticeTranslation, | ||
| } from "../../lib/i18n"; | ||
| import { useI18n } from "../../lib/i18n/i18n-context"; | ||
| import { getOverridesByType } from "../../lib/initialize"; |
Contributor
Author
There was a problem hiding this comment.
unrelated lint error (from a prior PR) because this was no longer used
Pre-seeds a cookie with prior consent for an unrelated notice and "advertising" listed in non_applicable_notice_keys. With a current experience that serves "advertising" applicably, the banner should resurface once, dismissing should write advertising into the consent map, and subsequent reloads should keep the banner hidden.
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.
Ticket ENG-3648
Description Of Changes
When a notice key was previously stored in the user's
fides_consentcookie undernon_applicable_notice_keys(e.g. left over from a prior region) and that same notice later becomes applicable in the current experience, the banner correctly resurfaces once — but dismissing it had no effect, so the banner kept resurfacing on every page load until the user explicitly saved preferences.Root cause:
handleDismissinNoticeOverlayshort-circuited whenever the saved cookie had any consent values set. In the bug scenario the saved cookie carried decisions for the prior region's notices ({essential: true, marketing: true, ...}) but had no entry for the newly-applicable notice. The guard treated "some consent set" as "user has decided everything," skippedhandleUpdatePreferences, and the new notice was never written to the consent map.Fix: tighten the guard so it only skips when every currently-applicable notice already has a recorded preference. If any served notice is missing from the saved consent map, dismiss now records defaults for that notice while preserving existing
truedecisions (viagetEnabledNoticeKeys).Behavior now matches the ticket's expectation:
consentwith their default valuesCode Changes
clients/fides-js/src/components/notices/NoticeOverlay.tsx— replace theconsentCookieObjHasSomeConsentSetguard inhandleDismisswith a check that runshandleUpdatePreferenceswhenever any currently-applicable notice has no recorded preference. Drop the now-unused import.clients/privacy-center/cypress/e2e/fides-js/banner-overlay-dismissal.cy.ts— add an E2E regression that pre-seeds the bug scenario (prior consent for one notice,advertisinginnon_applicable_notice_keys, served applicably), dismisses, and asserts the cookie'sconsentmap gainsadvertisingwithconsentMethod: dismiss, then reloads and asserts the banner stays hidden.Steps to Confirm
Advertising). Do not include any other notices — any extra served notice that isn't accounted for in the seeded cookie below will legitimately trigger a resurface and mask the fix.notice_keyof the served notice (e.g.advertising).fides_consentto the following (URL-encoded), replacingadvertisingwith thenotice_keyfrom step 2. The cookie has prior decisions for unrelated notices and listsadvertisingas previously non-applicable:{"consent":{"essential":true,"marketing":false},"identity":{"fides_user_device_id":"9e129592-2acc-4a86-bb7d-1e500c4a76ef"},"fides_meta":{"version":"0.9.0","createdAt":"2026-03-18T22:11:37.070Z","updatedAt":"2026-03-18T22:11:39.476Z","consentMethod":"accept"},"tcf_consent":{},"non_applicable_notice_keys":["advertising"]}advertisingis now applicable and has no entry inconsent).consentshould now includeadvertising: falseandconsentMethodshould bedismiss.cd clients/fides-js && npm run build), repeat steps 4–8. After dismissing, the cookie'sconsentwill be unchanged (noadvertisingentry) and the banner resurfaces on every reload.Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works