segmentio / consent-manager

Drop-in consent management plugin for analytics.js
https://segmentio.github.io/consent-manager/
MIT License
340 stars 142 forks source link

The prop workspaceAddedNewDestinations is true whenever the page is reloaded #325

Open pea opened 1 year ago

pea commented 1 year ago

The prop workspaceAddedNewDestinations is set to true whenever the page is reloaded. This is not expected behavior, as the prop should only be set to true when new destinations are added to the workspace.

Steps to Reproduce:

  1. Open the page.
  2. Reload the page.
  3. Verify that the prop workspaceAddedNewDestinations is true.

Expected Behavior:

The prop workspaceAddedNewDestinations should be false when the page is loaded. It should only be set to true when new destinations are added to the workspace.

Actual Behavior:

The prop workspaceAddedNewDestinations is set to true whenever the page is loaded, even if no new destinations have been added.

edsonjab commented 1 year ago

Hi @pea thank you for your report, we start looking into this.

edsonjab commented 1 year ago

Hi @pea sorry to answer late, the property workspaceAddedNewDestinations works correctly when you didn't define initialPreferences and customPreferences and finally you need to have configurated the defaultDestinationBehavior with value imply.

pea commented 1 year ago

The issue was that all destinations had to be set to either true or false. I was setting them to true/ false individually. So if one was toggled on, that one should be true but the others should also be set as false.

edsonjab commented 1 year ago

Hi @pea I created a PR #347 to fix the issue with save methods

pea commented 1 year ago

Thanks for jumping on that so quickly @edsonjab. I've just come back from vacation but I'll test it out today.