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

Fix loading of the analytics preference so it will send events if user has opted in #2605

Merged
merged 5 commits into from
Jan 28, 2021

Conversation

belcherj
Copy link
Contributor

Fix

Ensure that we set the analyticsAllowed value on window when page loads and the preferences bucket is ready.

Test

  1. Sign in
  2. Have analytics enabled
  3. Ensure window.analyticsEnabled is set
  4. Refresh
  5. Ensure window.analyticsEnabled is set

@belcherj belcherj requested a review from dmsnell January 28, 2021 04:34
@belcherj belcherj self-assigned this Jan 28, 2021
preferencesBucket.channel.once('ready', () => {
dispatch({
type: 'REMOTE_ANALYTICS_UPDATE',
allowAnalytics: getState().data.analyticsAllowed,
Copy link
Member

Choose a reason for hiding this comment

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

I think here we want allowAnalytics: !!(await preferencesBucket.get('preferences-key'))?.analytics_enabled or whatever it takes to do that. maybe this works too and it won't matter much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

@belcherj belcherj changed the title Fix loading of the analytics preference so send events if user has opted in Fix loading of the analytics preference so it will send events if user has opted in Jan 28, 2021
@codebykat codebykat self-requested a review January 28, 2021 10:08
Copy link
Member

@codebykat codebykat left a comment

Choose a reason for hiding this comment

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

Do we want this as a hotfix into 2.6.0?

Code looks sensible to me, I did not test it. I'm happy to do so tomorrow, but I empower you to merge before then if you're confident.

@codebykat codebykat changed the base branch from develop to release/2.6.0 January 28, 2021 21:08
@codebykat codebykat merged commit 3a361a4 into release/2.6.0 Jan 28, 2021
@codebykat codebykat deleted the fix/analytics branch January 28, 2021 23:56
@codebykat codebykat added this to the 2.6.0 ❄ milestone Jan 29, 2021
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.

3 participants