-
Notifications
You must be signed in to change notification settings - Fork 30
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
Prepare DCR for an AB test between user benefits api & members data api #13113
base: main
Are you sure you want to change the base?
Conversation
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
Size Change: -79 B (-0.01%) Total Size: 870 kB ℹ️ View Unchanged
|
e9c81aa
to
2ac27fb
Compare
2ac27fb
to
9122d78
Compare
expires.setMonth(expires.getMonth() + 6); | ||
setCookie({ | ||
name: AD_FREE_USER_COOKIE, | ||
value: expires.getTime().toString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the expires value mean if the cookie is valid for daysToLive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem a bit odd doesn't it? This logic was already there so I left it in place. I don't think it will hurt although it may well be redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice
removeCookie({ name: AD_FREE_USER_COOKIE }); | ||
removeCookie({ name: USER_FEATURES_EXPIRY_COOKIE }); | ||
removeCookie({ name: HIDE_SUPPORT_MESSAGING_COOKIE }); | ||
return Promise.resolve(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think because this function is async
the return value will always be a promise, so this could just be
return Promise.resolve(); | |
return; |
(or could even be omitted completely).
What does this change?
Extracts the logic relating to the members-data-api from the user features code
Why?
We want to run an AB test where we use the new user-benefits api instead of members-data-api to work out whether a user is entitled to ad-free and hidden support messaging.
The point of the AB test is just to roll out the new service in a gradual way so that we can manage the scale effectively.
This PR does some final refactoring of the existing code to make it easier to run this test, but because the changes are relatively extensive I'm putting it in as a stand alone PR.
Screenshots