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

GPP serving TCF strings #4433

Merged
merged 19 commits into from
Nov 22, 2023
Merged

GPP serving TCF strings #4433

merged 19 commits into from
Nov 22, 2023

Conversation

allisonking
Copy link
Contributor

@allisonking allisonking commented Nov 15, 2023

Closes https://ethyca.atlassian.net/browse/PROD-1285

Description Of Changes

https://www.loom.com/share/ce626a97f570422389e9b0116a3f5bde

Code Changes

Steps to Confirm

  • Watch the loom video—there are a few small changes in the code needed to get this working. This feature isn't "enabled" yet, and can only be done manually this way.
  • Try out the various gpp functions
  • Opt in/out of consents and check the gpp string. you can decode it here https://iabgpp.com/#

Pre-Merge Checklist

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

Copy link

vercel bot commented Nov 15, 2023

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 Nov 22, 2023 4:40pm

Copy link

cypress bot commented Nov 15, 2023

Passing run #5342 ↗︎

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 6588867 into 5790645...
Project: fides Commit: 8cbe23853c ℹ️
Status: Passed Duration: 00:33 💡
Started: Nov 22, 2023 4:51 PM Ended: Nov 22, 2023 4:52 PM

Review all test suite changes for PR #4433 ↗︎

@allisonking allisonking changed the base branch from main to aking/prod-1284/gpp-poc November 15, 2023 18:36
import { makeStub } from "../lib/gpp/stub";
import { fidesEventToTcString } from "../lib/tcf/events";

const CMP_ID = 407; // TODO: is this supposed to be the same as TCF, or is this separate?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

she has confirmed! We can just use our TCF CMP ID, so let's remove this comment

@@ -368,7 +368,7 @@ export const initialize = async ({
identity: cookie.identity,
fides_string: cookie.fides_string,
tcf_consent: cookie.tcf_consent,
experience,
experience: effectiveExperience,
Copy link
Contributor Author

@allisonking allisonking Nov 17, 2023

Choose a reason for hiding this comment

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

this is a potentially consequential change—before, if the experience was not server side provided, then window.Fides.experience would be undefined. I don't think there was a reason for this, and I didn't see why we shouldn't always have the effective experience here. but let me know if I'm missing something!

This basically makes it possible for the "FidesInitialized" listener in gpp.ts to grab the experience easily, without it having to come through the event object.

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good. The return obj built here is only used to update the window.Fides obj, which we don't rely on to make any functional decisions within or outside of Fides. Regardless, we should absolutely return the most up-to-date experience here. Thanks!

@@ -149,25 +149,6 @@ export const generateFidesString = async ({
return Promise.resolve(encodedString);
};

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to a separate file so gpp can also use this function

@allisonking allisonking marked this pull request as ready for review November 17, 2023 22:08
}, [cookie, options.debug]);
const dispatchCloseEvent = useCallback(
({ saved = false }: { saved?: boolean }) => {
dispatchFidesEvent("FidesModalClosed", cookie, options.debug, { saved });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need to know if the modal was closed without saving. gpp signals that it is not ready when the modal opens. once it saves, it signals it is ready again. but if you close the modal without saving, we'd be stuck in a "not ready" state

Base automatically changed from aking/prod-1284/gpp-poc to main November 20, 2023 17:41
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.

Great work on this @allisonking !

Do we have a separate ticket to add e2e tests, once we actually start making calls to the GPP lib?

Thumbs up from me, just need to remove an unneeded code comment 👍

import { makeStub } from "../lib/gpp/stub";
import { fidesEventToTcString } from "../lib/tcf/events";

const CMP_ID = 407; // TODO: is this supposed to be the same as TCF, or is this separate?
Copy link
Contributor

Choose a reason for hiding this comment

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

she has confirmed! We can just use our TCF CMP ID, so let's remove this comment

@@ -368,7 +368,7 @@ export const initialize = async ({
identity: cookie.identity,
fides_string: cookie.fides_string,
tcf_consent: cookie.tcf_consent,
experience,
experience: effectiveExperience,
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good. The return obj built here is only used to update the window.Fides obj, which we don't rely on to make any functional decisions within or outside of Fides. Regardless, we should absolutely return the most up-to-date experience here. Thanks!

@allisonking
Copy link
Contributor Author

Thanks for the review @eastandwestwind ! I'll clean that comment up.

Do we have a separate ticket to add e2e tests, once we actually start making calls to the GPP lib?

Yes! It is here: https://ethyca.atlassian.net/browse/PROD-1420

@allisonking allisonking merged commit e40b6aa into main Nov 22, 2023
13 checks passed
@allisonking allisonking deleted the aking/prod-1285/gpp-tcf-strings branch November 22, 2023 19:21
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