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

[Bug]: Clicking Save Preferences button rejects all services regardless of toggle state #700

Closed
peaemaye opened this issue Jun 25, 2024 · 1 comment · Fixed by #701
Closed
Labels
bug Something isn't working
Milestone

Comments

@peaemaye
Copy link
Contributor

peaemaye commented Jun 25, 2024

Expected Behavior

Should save the current service selection.

Current Behavior

All services are rejected and fire their onReject event.

Steps to reproduce

See this StackBlitz for a minimal repro: https://stackblitz.com/edit/stackblitz-starters-xtbkbf?file=index.js

  1. Click Open Preview in new tab icon to open in new window that will retain cookies on reload.
  2. Open F12 developer tools to see console.log entries.
  3. Click Accept all to accept all categories/services.
  4. Press F5 to reload the page.
  5. Click the Show preferences modal button to open the preferences window.
  6. Expand the Analytics cookies section to see that Service1 and Service2 are active.
  7. Click Save preferences to save the current selection without making any changes.

Proposed fix or additional info.

See PR: #701

Version

3.0.1

On which browser do you see the issue?

Firefox, Chrome

@peaemaye
Copy link
Contributor Author

I think I've found the cause of this issue. The retrieveState method of api.js currently sets the _enabledServices before _acceptedServices so the enabled services don't include services read from the cc-cookie. I think reversing this order is sufficient to fix it.

See pull request #701

@peaemaye peaemaye mentioned this issue Jun 28, 2024
@orestbida orestbida removed the triage yet to be reviewed label Jul 2, 2024
@orestbida orestbida added this to the v3.1.0 milestone Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants