Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rely on client to detect new notices for prefetched experiences #4009

Merged
merged 10 commits into from
Aug 31, 2023

Conversation

eastandwestwind
Copy link
Contributor

@eastandwestwind eastandwestwind commented Aug 31, 2023

Closes #4001

Description Of Changes

This PR removes the need for fides_user_device_id in pre-fetched experience. Instead, pre-fetched experience now returns no user consent. It now relies on the client cookie, if exists, to populate any existing consent for all notices.

Code Changes

  • Add code to populate user consent for any pre-fetched experience provided the Fides cookie exists
  • Ensure that fides_user_device_id query param is not passed to the fides API if it does not exist

Steps to Confirm

  • Add relevant Fides configs to ensure a banner will show up for your region
  • Use the following env vars:
FIDES_PRIVACY_CENTER__DEBUG=true
FIDES_PRIVACY_CENTER__IS_OVERLAY_ENABLED=true
FIDES_PRIVACY_CENTER__IS_PREFETCH_ENABLED=true
FIDES_PRIVACY_CENTER__IS_GEOLOCATION_ENABLED=true
FIDES_PRIVACY_CENTER__GEOLOCATION_API_URL=https://cdn-api.ethyca.com/location
FIDES_PRIVACY_CENTER__TCF_ENABLED=false
FIDES_PRIVACY_CENTER__PRIVACY_CENTER_URL=http://localhost:3000
  • Nav to http://localhost:3000/fides-js-demo.html
  • Confirm that Consent Experience section of the page is populated. This means pre-fetch worked.
  • Confirm that banner shows up
  • Make a consent selection
  • Reload page
  • Confirm banner does NOT show up again

Pre-Merge Checklist

@cypress
Copy link

cypress bot commented Aug 31, 2023

Passing run #3875 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 3bbc45f into 194005a...
Project: fides Commit: c71bb791db ℹ️
Status: Passed Duration: 01:06 💡
Started: Aug 31, 2023 9:42 PM Ended: Aug 31, 2023 9:43 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Contributor

@SteveDMurphy SteveDMurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy to follow the path of the cookie loading for any existing consent, thanks for burning through this @eastandwestwind !!

Approving knowing tests are being worked on but looks good and the videos were really helpful as well

clients/fides-js/src/fides.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions and nits, as per usual from yours truly :)

clients/fides-js/src/fides.ts Outdated Show resolved Hide resolved
clients/fides-js/src/fides.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more comment, I'm willing to negotiate as well 😄

clients/fides-js/src/lib/cookie.ts Show resolved Hide resolved
Copy link
Contributor

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, ship it!

@eastandwestwind eastandwestwind merged commit 633e554 into main Aug 31, 2023
10 checks passed
@eastandwestwind eastandwestwind deleted the 4001-detect-new-notices-on-client-for-prefetch branch August 31, 2023 22:14
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.

Banner resurfaces after user consent for pre-fetch experience
3 participants