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

Apply any updated state to the overlay #5384

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Oct 15, 2024

Closes HJ-22

Description Of Changes

If GPC (browser's "Do Not Track") is being applied after Fides initialization, we need to update the initial overlay to reflect the new state.

This is especially important for Firefox browsers (Gecko) because—not only does FF make it easy to enable GPC—GPC gets applied rather late due to how Gecko handles queuing the setTimeout on the last step of our initialize function.

Code Changes

  • Add an event watch for FidesUpdating and use that to update the Overlay's notices as applicable

Steps to Confirm

  • Enable GPC in Firefox.
  • Using Firefox now, visit demo page of (or create) an Experience with config:
    • Modal only
    • GPP enabled for U.S. National
    • Location in the united states
    • "Data Sales, Sharing, and Targeted Advertising (GPP - US National)" privacy notice enabled
    • pass U.S. geolocation to the browser if necessary
  • Click the Manage Privacy link to open the browser
  • Ensure that the privacy policy is "Applied" via GPC and not "Overriden"
    CleanShot 2024-10-15 at 17 46 55@2x

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Issue Requirements are Met
  • Update CHANGELOG.md

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2024 2:45pm

Copy link

cypress bot commented Oct 15, 2024

fides    Run #10464

Run Properties:  status check passed Passed #10464  •  git commit 9f4160271f ℹ️: Merge ac46a987b0f91d2503aa16adfed81edc28e16c03 into 46cc4155f7e2c12fe871ef60069f...
Project fides
Run status status check passed Passed #10464
Run duration 00m 40s
Commit git commit 9f4160271f ℹ️: Merge ac46a987b0f91d2503aa16adfed81edc28e16c03 into 46cc4155f7e2c12fe871ef60069f...
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

@gilluminate gilluminate force-pushed the HJ-22-incorrect-gpc-signal-on-manual branch from a86b4be to c52a4c3 Compare October 16, 2024 00:11
@gilluminate gilluminate marked this pull request as ready for review October 16, 2024 00:16
@gilluminate gilluminate force-pushed the HJ-22-incorrect-gpc-signal-on-manual branch from c52a4c3 to ed40fda Compare October 16, 2024 01:45
Copy link
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

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

Looks good, just a minor naming thing. Consent state management overall in Fides-js needs a re-work imo, to find a source of truth between cookie / api / event obj / Fides window obj consent states 😬

CHANGELOG.md Outdated
@@ -20,6 +20,7 @@ The types of changes are:
### Fixed
- Fixed a bug where D&D tables were rendering stale data [#5372](https://github.com/ethyca/fides/pull/5372)
- Fixed issue where Dataset with nested fields was unable to edit Categories [#5383](https://github.com/ethyca/fides/pull/5383)
- Fixed racecondition where GPP being updated after FidesJS initialization caused Privacy Notices to be in the wrong state [#5384](https://github.com/ethyca/fides/pull/5384)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you mean GPC here?

@@ -124,6 +125,11 @@ const NoticeOverlay: FunctionComponent<OverlayProps> = ({
Array<string>
>(initialEnabledNoticeKeys());

window.addEventListener("FidesUpdating", (event) => {
// If GPP is being applied after initialization, we need to update the initial overlay to reflect the new state. This is especially important for Firefox browsers (Gecko) because GPP gets applied rather late due to how it handles queuing the `setTimeout` on the last step of our `initialize` function.
Copy link
Contributor

Choose a reason for hiding this comment

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

same here GPC

@gilluminate gilluminate merged commit 88a32f0 into main Oct 16, 2024
13 checks passed
@gilluminate gilluminate deleted the HJ-22-incorrect-gpc-signal-on-manual branch October 16, 2024 15:01
@Kelsey-Ethyca Kelsey-Ethyca mentioned this pull request Oct 16, 2024
14 tasks
Copy link

cypress bot commented Oct 16, 2024

fides    Run #10484

Run Properties:  status check passed Passed #10484  •  git commit 88a32f00b5: Apply any updated state to the overlay (#5384)
Project fides
Run status status check passed Passed #10484
Run duration 00m 38s
Commit git commit 88a32f00b5: Apply any updated state to the overlay (#5384)
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

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.

2 participants