Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

use Services.telemetry.canRecordBase, enable snippets by default #3057

Merged
merged 3 commits into from
Aug 1, 2017

Conversation

k88hudson
Copy link
Contributor

@k88hudson k88hudson commented Aug 1, 2017

Fix #3056 and fix #3007.

I've updated the PR to also fix TelemetrySender and related tests, as well as updating the value on every new tab init.'

I also snuck a .hasFxAccount property into snippets data

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 631bda1 on k88hudson:gh3007 into 729f4c6 on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 31c560f on k88hudson:gh3007 into 729f4c6 on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling e6d4fa1 on k88hudson:gh3007 into 729f4c6 on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 286e5e2 on k88hudson:gh3007 into 1b4406c on mozilla:master.

Copy link
Member

@dmose dmose left a comment

Choose a reason for hiding this comment

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

This looks good. In addition to the inline comments, two questions:

  • it seems surprising that the snippets telemetry is not governed by both the global telemetry pref and the a-s telemetry pref, the way TelemetrySender is. Maybe the snippets code wants to call into the TelemetrySender code to check for enablement, rather than calling into the Service directly?

  • Since we're turning on snippets by default, are there any prefs we need to touch in m-c so the mochitests from the rest of the tree don't start exploding with the "non-local network requests" error?

onboardingFinished: Services.prefs.getBoolPref(ONBOARDING_FINISHED_PREF)
};

this.store.dispatch(ac.BroadcastToContent({type: at.SNIPPETS_DATA, data}));
}
_refreshCanRecordBase() {
// TODO: There is currently no way to listen for changes to this value;
// bug is filed here https://bugzilla.mozilla.org/show_bug.cgi?id=1386318
Copy link
Member

Choose a reason for hiding this comment

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

Maybe mention that for now, we're doing the best effort of calling this each time a new tab is initialized.

@@ -15,6 +15,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "ProfileAge",
// Url to fetch snippets, in the urlFormatter service format.
const SNIPPETS_URL_PREF = "browser.aboutHomeSnippets.updateUrl";
const ONBOARDING_FINISHED_PREF = "browser.onboarding.notification.finished";
const FXA_USERNAME_PREF = "services.sync.username";
Copy link
Member

Choose a reason for hiding this comment

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

Does sending this need data review?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's already implemented in existing snippets, I would assume not

@Mardak
Copy link
Member

Mardak commented Aug 1, 2017

Do we want to hold off on merging this? Or have a temporary mozilla-central-patches to prevent pine failures see https://bugzilla.mozilla.org/show_bug.cgi?id=1386350 ?

@Mardak
Copy link
Member

Mardak commented Aug 1, 2017

Eh, actually last time we had a separate PR to add the patch. That make it simple to revert that one PR.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 5300b7f on k88hudson:gh3007 into 1b4406c on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling b26da19 on k88hudson:gh3007 into 970b789 on mozilla:master.

@k88hudson k88hudson merged commit 94603de into mozilla:master Aug 1, 2017
@as-pine-proxy
Copy link
Collaborator

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Snippets by default Snippets: Read telemetryEnabled from Services.telemetry.canRecordBase.
5 participants