Repository navigation
Send a denied Consent Mode update and notify add-ons when consent is withdrawn - #29
Conversation
…tion" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…withdrawn Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c32ec615ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (Array.isArray(filtered)) { | ||
| patterns = filtered; |
There was a problem hiding this comment.
Validate each pattern returned by the browser filter
If an add-on returns an array containing a non-string value, such as [null], this accepts it and later matchesPurgePattern() throws on pattern.charAt(...). For an undecided visitor with any cookie, that exception escapes the initialization-time purge and prevents the consent banner from being revealed or wired, so a malformed optional filter can leave the visitor unable to provide consent. Filter the result to valid strings or fall back to the original patterns when any entry is invalid.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e7faa52.
purgeTrackingCookies() now only uses the filter's result when it is an array of non-empty strings. Anything else (e.g. [null], numbers, empty strings) is ignored and the full purge list is used, the same fallback as when the filter throws, so matchesPurgePattern() can no longer throw and the page-load purge can't stop the banner from being shown and wired.
Regression test added in tests/js/cookie-notice-purge.test.js: a filter returning [null, '_gid'] on page load no longer throws, every tracking cookie is deleted and the banner's buttons are wired. It fails without the fix. JS tests 49/49, composer lint and composer phpstan clean; .min.js regenerated with npm run build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l-cleanup # Conflicts: # readme.md
davidperezgar
left a comment
There was a problem hiding this comment.
Revisado: la retirada del consentimiento manda el update denied antes del purge, el filtro se ignora en retirada total y valida lo que devuelve, y los tests cubren los casos.
Generated by Claude Code
Summary
Improve consent withdrawal and cookie cleanup, while providing generic extension points for add-ons such as FrontConsent PRO.
Base:
main. It was stacked on #28, which is now merged;mainhas been merged into this branch to resolve areadme.mdconflict, so the diff only shows this PR's changes.Findings
[null]) must not block the banner (Codex review)Changes
Consent withdrawal
Send a Consent Mode update with all four supported signals set to
deniedbefore purging tracking cookies and reloading the page.Add-on notification
Introduce the
frcnCookieConsentWithdrawndocument event so add-ons can react to consent withdrawal and clear their own stored consent.Cookie cleanup extension
Introduce
window.frcnCookieNoticeFilterPurgePatterns(patterns)so add-ons can narrow the list of cookies to purge.FrontConsent Free remains binary and does not introduce consent categories.
Assets and documentation
npm run build.readme.md.Tests
composer validate,composer lint,composer phpstan, PHPUnit (135/135, before mergingmain; CI runs it again on this PR) andnpm run test:js(49/49, also after mergingmain).Scope
PRO-specific consent handling will be implemented in a separate PR in the PRO repository.
No version bump or changelog changes.
🤖 Generated with Claude Code