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

Refresh page on consent change #1225

Merged
merged 7 commits into from
Mar 5, 2024
Merged

Conversation

emma-imber
Copy link
Contributor

@emma-imber emma-imber commented Jan 24, 2024

What does this change?

Adds a module to refresh the page when consent state changes, and an E2E test to wait for a page reload when consent state changes.

Also deletes the module to remove consented ads on consent withdrawal, as we no longer need this if we're refreshing the page immediately.

Why?

This means our data will correctly reflect the page consent status, and that users will immediately experience the appropriate ad experience on consent change.

Copy link

changeset-bot bot commented Jan 24, 2024

🦋 Changeset detected

Latest commit: 8e0a65c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@guardian/commercial Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@emma-imber emma-imber added the [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR label Jan 24, 2024
Copy link
Contributor

🚀 0.0.0-beta-20240124105308 published to npm as a beta release

@emma-imber emma-imber added [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR and removed [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR labels Jan 24, 2024
Copy link
Contributor

🚀 0.0.0-beta-20240124125623 published to npm as a beta release

@emma-imber emma-imber force-pushed the ei/refresh-page-on-consent-change branch 3 times, most recently from 78e0d03 to d63455b Compare February 8, 2024 12:19
@emma-imber emma-imber added [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR and removed [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR labels Feb 8, 2024
Copy link
Contributor

github-actions bot commented Feb 8, 2024

🚀 0.0.0-beta-20240208122858 published to npm as a beta release

@emma-imber emma-imber force-pushed the ei/refresh-page-on-consent-change branch from 5e05d5a to 2759d28 Compare February 13, 2024 10:34
@emma-imber emma-imber added [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR and removed [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR labels Feb 13, 2024
Copy link
Contributor

🚀 0.0.0-beta-20240213111558 published to npm as a beta release

@emma-imber emma-imber force-pushed the ei/refresh-page-on-consent-change branch from 46e4595 to 8f2390f Compare February 26, 2024 17:38
@emma-imber emma-imber force-pushed the ei/refresh-page-on-consent-change branch from 8f2390f to 051a7f4 Compare February 27, 2024 16:55
@emma-imber emma-imber added [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR and removed [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR labels Feb 27, 2024
Copy link
Contributor

🚀 0.0.0-beta-20240227165933 published to npm as a beta release

@emma-imber emma-imber marked this pull request as ready for review February 27, 2024 17:39
@emma-imber emma-imber requested a review from a team as a code owner February 27, 2024 17:39
@emma-imber emma-imber removed the [beta] @guardian/commercial Add this label to publish an @guardian/commercial beta npm release from a PR label Feb 28, 2024
Copy link
Member

@Jakeii Jakeii left a comment

Choose a reason for hiding this comment

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

Nice! Finally over the line!

}, true);
};

const reloadPageOnConsentChange = once(() =>
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why we need to once() as I thought we would only call this in the boot script?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot - I think this is from the original PR back in frontend. I've removed it and seems to work fine without!

Copy link
Member

@arelra arelra left a comment

Choose a reason for hiding this comment

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

🥳

ps @zekehuntergreen 😉

@emma-imber emma-imber merged commit 9baa4cb into main Mar 5, 2024
10 checks passed
@emma-imber emma-imber deleted the ei/refresh-page-on-consent-change branch March 5, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants