Skip to content

Conversation

@jjdaurora
Copy link
Contributor

Ticket []

Description Of Changes

Code Changes

Steps to Confirm

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@jjdaurora jjdaurora requested a review from a team as a code owner February 5, 2026 19:00
@jjdaurora jjdaurora requested review from jpople and removed request for a team February 5, 2026 19:00
@vercel
Copy link
Contributor

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Feb 5, 2026 7:00pm
fides-privacy-center Ignored Ignored Feb 5, 2026 7:00pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This PR changes shouldResurfaceBanner() for TCF experiences so that the banner is resurfaced when the prior consent method was DISMISS or REJECT, and updates the corresponding Jest test expectation.

The change is localized to the fides-js consent utility that controls whether the consent UI is shown again based on saved cookie state + experience metadata (TCF version hash, vendors, overrides).

Confidence Score: 3/5

  • Moderately safe to merge once the cookie meta access is made robust and the test table label is corrected.
  • Behavior change is small and covered by an updated test, but the new branch reads cookie.fides_meta without a guard, which can cause a runtime exception with malformed/legacy cookies; one test label is also now inaccurate.
  • clients/fides-js/src/lib/consent-utils.ts

Important Files Changed

Filename Overview
clients/fides-js/src/lib/consent-utils.ts Updates TCF banner resurfacing to return true when consent method is DISMISS/REJECT; new unconditional access to cookie.fides_meta can throw if fides_meta is missing.
clients/fides-js/tests/lib/consent-utils.test.ts Adjusts shouldResurfaceBanner TCF dismissed expectation to true; one test case label now contradicts the expected value.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +287 to +292
if (
cookie.fides_meta.consentMethod === ConsentMethod.DISMISS ||
cookie.fides_meta.consentMethod === ConsentMethod.REJECT
) {
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible crash on missing meta

cookie.fides_meta.consentMethod is accessed without guarding cookie.fides_meta. If a persisted/legacy cookie exists without fides_meta (or it’s been partially cleared), shouldResurfaceBanner() will throw for TCF experiences, breaking banner rendering. Consider optional-chaining (e.g. cookie.fides_meta?.consentMethod) or defaulting fides_meta when deserializing cookies so this path can’t throw.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Additional Comments (1)

clients/fides-js/__tests__/lib/consent-utils.test.ts
Test label mismatch

This case label says it "returns false" but expected is now true, which makes the table-driven tests misleading.

      label: "returns true for TCF when banner has been dismissed",

@jjdaurora jjdaurora added the do not merge Please don't merge yet, bad things will happen if you do label Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Please don't merge yet, bad things will happen if you do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant