[amp-consent] Granular consents change detection doesn't work. New selection is not saved in the amp-store local storage and the update request is not sent #38350
Only changing general consent alternately (accept, reject, accept, reject) triggers all these changes.
It would be good to include granular consents to change detection or add some possibility to do it manually.
By manually I mean something like:
tap:siteConsent.accept(isDirty/forceUpdate=true)
and for consents in iframe (promptUISrc):
window.parent.postMessage({ type: 'consent-response', action: 'accept', purposeConsents, isDirty/forceUpdate: true }, "*");
Check your local storage value. You can also decode base64 value in the console with:
decodeURIComponent(atob(localStorage['amp-store:https://playground.amp.dev']))
Reprompt settings dialog with "I do!" button
Change your settings
The list of choices (See the results of your consent choices here) doesn't reflect new selection
Check again local storage value
If you change the second button action tap:siteConsent.dismiss with tap:siteConsent.reject and click buttons alternately you will notice changes (to make data-block-on-consent-purposes reflect new granular consents just refresh the preview)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Description
There's an issue with detecting change of granular consents when user wants to update his settings. None of the following actions are triggered:
Only changing general consent alternately (accept, reject, accept, reject) triggers all these changes. It would be good to include granular consents to change detection or add some possibility to do it manually.
By manually I mean something like:
tap:siteConsent.accept(isDirty/forceUpdate=true)
and for consents in iframe (promptUISrc):window.parent.postMessage({ type: 'consent-response', action: 'accept', purposeConsents, isDirty/forceUpdate: true }, "*");
Reproduction Steps
Repro 1. Granular consents not saved in the amp-store in local storage Granular consents example playground
Scenario:
decodeURIComponent(atob(localStorage['amp-store:https://playground.amp.dev']))
Repro 2. Update request is not sent
Modified granular consents example playground
It's the same example with additionaly:
config for onUpdateHref
'reject' action instead of 'dismiss'
Scenario:
Relevant Logs
No response
Browser(s) Affected
No response
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
2206221455000