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

Narrow vendors disclosed to only the vendors we show in the UI #4250

Merged
merged 8 commits into from
Oct 13, 2023

Conversation

allisonking
Copy link
Contributor

@allisonking allisonking commented Oct 10, 2023

Closes #4165

Description Of Changes

The library we use wants to put every vendor in the GVL as part of the vendors_disclosed string. According to the docs, we should only put the vendors we've disclosed, i.e. the ones we've shown in the UI (makes sense!). There's a vendors_disclosed field we can set, but that appears to always be overwritten by the library to set the whole GVL. I believe the way around this is to use the library's narrowVendorsTo function

Part of this ticket is also to not surface the vendor disclosed part of the string to the CMP API—that's covered in #4244

Code Changes

  • Narrow the GVL to just the vendors we show in the UI
  • Add test

Steps to Confirm

  • Set up your TCF environment
  • Opt in to some vendors. Inspect your cookie's tc_string object. it should have two parts, separated by a period. The second part should be very short (it used to be a very long string that ended with AAAAAAAAAAAAAAAAQ)
  • If you decode this string here you should see that there are only a few vendors disclosed (the ones shown in the UI)

Pre-Merge Checklist

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

@cypress
Copy link

cypress bot commented Oct 10, 2023

Passing run #4635 ↗︎

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 65713f2 into 6e5e4a5...
Project: fides Commit: 30b53c67f7 ℹ️
Status: Passed Duration: 00:56 💡
Started: Oct 13, 2023 6:23 PM Ended: Oct 13, 2023 6:24 PM

Review all test suite changes for PR #4250 ↗︎

@allisonking allisonking marked this pull request as ready for review October 10, 2023 20:33
Comment on lines -43 to -76
if (
tcStringPreferences.vendorsConsent &&
tcStringPreferences.vendorsConsent.length > 0
) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need these ifs: it's always an array, and even if it's empty, the forEach below won't do anything

// Narrow the GVL to say we've only showed these vendors provided by our experience
const vendorIds = [
...(experience.tcf_vendor_consents?.map((v) => +v.id) || []),
...(experience.tcf_vendor_legitimate_interests?.map((v) => +v.id) || []),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, Dawn's commit here 7b86c15 reminded me that in addition we should filter to just the IDs that are GVL, now that we are supporting AC. I will do that shortly

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

Looks great @allisonking, verified your vendors disclosed sections for accept all/reject all also match what the backend is generating.

Just that gvl filter left -

...(experience.tcf_vendor_consents?.map((v) => +v.id) || []),
...(experience.tcf_vendor_legitimate_interests?.map((v) => +v.id) || []),
];
tcModel.gvl.narrowVendorsTo(vendorIds);
Copy link
Contributor

Choose a reason for hiding this comment

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

ah! narrowVendorsTo, good find

narrowVendorsTo - narrows vendors represented in this GVL to the list of ids passed in

@allisonking
Copy link
Contributor Author

thank you @pattisdr !!

Just that gvl filter left -

thank you for the reminder—I knew there was something I left off of a PR somewhere but totally forgot it was this one! will address that now

@allisonking allisonking merged commit 713c7cc into main Oct 13, 2023
9 checks passed
@allisonking allisonking deleted the aking/4165/vendors-disclosed branch October 13, 2023 18:49
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.

Only list vendors in the data map as vendors_disclosed in the FE
2 participants