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

When the TC String is included in GPP and Layer 1 is visible, the signalStatus should be "not ready" #4957

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Jun 5, 2024

Closes PROD-2020

Description Of Changes

Adding a check for TCF when setting the signal status to ensure it doesn't get set incorrectly. We've been setting it to "ready" too early in TCF enabled environments.

Code Changes

  • first added signal status tests to TCF disabled scenario to make sure those do not change or get broken with the rest of these changes
  • check for TCF when setting the signal status to "ready"
  • added comments and clean up to test scenarios for accuracy

Steps to Confirm

  1. Enable TCF and GPP
  2. Add some GVL vendors so that TCF will appear in the EU
  3. Visit demo site with EU geolocation (eg. /fides-js-demo.html?geolocation=fr-id)
  4. When initial banner is visible, check the signalStatus of GPP - you can do this by opening the console and running __gpp('ping', ({signalStatus})=>{console.log(signalStatus)})
  5. You should see "not ready" in this scenario
  6. Now save the cookie by clicking "Opt out of all" (or something else) and recheck the signal status in the console
  7. You should now see "ready"
  8. Open the modal back up by clicking the Manage Preferences link
  9. recheck the signal status in the console, you should now see "not ready"
  10. Close the modal again and you should see "ready" again.

Pre-Merge Checklist

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

Copy link

vercel bot commented Jun 5, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Jun 5, 2024 9:36pm

@gilluminate gilluminate force-pushed the PROD-2020-when-the-tc-string-is-included branch from 1396afa to 5a8ec5d Compare June 5, 2024 21:35
Copy link

cypress bot commented Jun 5, 2024

Passing run #8150 ↗︎

0 4 0 0 Flakiness 0

Details:

Merge 0828b28 into de36758...
Project: fides Commit: a8493b1877 ℹ️
Status: Passed Duration: 00:34 💡
Started: Jun 5, 2024 9:48 PM Ended: Jun 5, 2024 9:48 PM

Review all test suite changes for PR #4957 ↗︎

@gilluminate gilluminate marked this pull request as ready for review June 6, 2024 15:15
@@ -133,18 +133,19 @@ const initializeGppCmpApi = () => {
makeStub();
const cmpApi = new CmpApi(ETHYCA_CMP_ID, CMP_VERSION);
cmpApi.setCmpStatus(CmpStatus.LOADED);
// If consent does not need to be resurfaced, then we can set the signal to Ready here
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was redundant with the notes starting on 141

Comment on lines +204 to +206
sectionsChanged.forEach((section) => {
cmpApi.fireSectionChange(section.name);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was confirmed to have been missing from before

Copy link
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

PR looks great. Approved!

window.addEventListener("FidesInitialized", (event) => {
// TODO (PROD-1439): re-evaluate if GPP is "cheating" accessing window.Fides instead of using the event details only
const { experience, saved_consent: savedConsent } = window.Fides;
const { experience, saved_consent: savedConsent, options } = window.Fides;
const isTcfEnabled = options.tcfEnabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

I also really like having boolean variables name starting with 'is' or 'has'.

@gilluminate gilluminate merged commit 806c646 into main Jun 6, 2024
13 checks passed
@gilluminate gilluminate deleted the PROD-2020-when-the-tc-string-is-included branch June 6, 2024 15:34
Copy link

cypress bot commented Jun 6, 2024

Passing run #8161 ↗︎

0 4 0 0 Flakiness 0

Details:

When the TC String is included in GPP and Layer 1 is visible, the signalStatus s...
Project: fides Commit: 806c646339
Status: Passed Duration: 00:35 💡
Started: Jun 6, 2024 3:46 PM Ended: Jun 6, 2024 3:47 PM

Review all test suite changes for PR #4957 ↗︎

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