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

Fix cookie update logic #4984

Merged
merged 3 commits into from
Jun 13, 2024
Merged

Conversation

gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Jun 13, 2024

Closes PROD-2196

Description Of Changes

Our cookie saving logic wasn't saving updates to the fides_consent cookie after it was first created.

Code Changes

  • use the updatedAt property to validate the cookie to ensure the domain checking logic doesn't get false positives when updating the cookie in addition to setting a new cookie.
  • Additional E2E tests to validate cookie can also be updated on any domain.

Steps to Confirm

  1. Visit https://cookiehouse-plus-rc.fides-staging.ethyca.com/?geolocation=US-CA
  2. Delete any existing fides_consent cookie
  3. Open the FidesJS modal and opt-out of “Targeted Advertising” and save changes
  4. Inspect the fides_consent cookie is created with false set for the notice
  5. Refresh the page
  6. Open the FidesJS modal and change your consent to opt-in of “Targeted Advertising” and save changes
  7. Inspect the fides_consent cookie has been updated, so true is now set for the notice

Pre-Merge Checklist

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

Copy link

vercel bot commented Jun 13, 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 13, 2024 6:05pm

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.

This LGTM!

Comment on lines +239 to +242
if (
savedCookie &&
savedCookie.fides_meta.updatedAt === cookie.fides_meta.updatedAt
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense 👍

Copy link

cypress bot commented Jun 13, 2024

Passing run #8308 ↗︎

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 8b4bd14 into 958ff68...
Project: fides Commit: c94e6fd8dc ℹ️
Status: Passed Duration: 00:34 💡
Started: Jun 13, 2024 6:16 PM Ended: Jun 13, 2024 6:17 PM

Review all test suite changes for PR #4984 ↗︎

@gilluminate gilluminate merged commit cfd306a into main Jun 13, 2024
13 checks passed
@gilluminate gilluminate deleted the gill/PROD-2196_we-transfer-updating branch June 13, 2024 18:23
gilluminate added a commit that referenced this pull request Jun 13, 2024
Copy link

cypress bot commented Jun 13, 2024

Passing run #8311 ↗︎

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

Details:

Fix cookie update logic (#4984)
Project: fides Commit: cfd306ae0c
Status: Passed Duration: 00:34 💡
Started: Jun 13, 2024 6:38 PM Ended: Jun 13, 2024 6:38 PM

Review all test suite changes for PR #4984 ↗︎

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