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

GH-2158: Subscription_type ping parameter not sending on login #606

Merged
merged 4 commits into from Sep 28, 2020
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -836,9 +836,6 @@ function onMessageHandler(request, sender, callback) {
const { email, password } = message;
account.login(email, password)
.then((response) => {
if (!response.hasOwnProperty('errors')) {
metrics.ping('sign_in_success');
}
callback(response);
})
.catch((err) => {
@@ -22,6 +22,7 @@ import conf from './Conf';
import dispatcher from './Dispatcher';
import { log } from '../utils/common';
import Api from '../utils/api';
import metrics from './Metrics';
import ghosteryDebugger from './Debugger';

const api = new Api();
@@ -87,7 +88,7 @@ class Account {
ghosteryDebugger.addAccountEvent('login', 'cookie set by fetch POST');
this._getUserIDFromCookie().then((userID) => {
this._setAccountInfo(userID);
this.getUserSubscriptionData();
this.getUserSubscriptionData({ calledFrom: 'login' });
});
return {};
});
@@ -168,7 +169,7 @@ class Account {
/**
* @return {array} All subscriptions the user has, empty if none
*/
getUserSubscriptionData = () => (
getUserSubscriptionData = options => (
this._getUserID()
.then(userID => api.get('stripe/customers', userID, 'cards,subscriptions'))
.then((res) => {
@@ -195,6 +196,9 @@ class Account {
this._setSubscriptionData(plusSubscription);
}
}
if (options && options.calledFrom === 'login') {
metrics.ping('sign_in_success');
}

return subscriptions;
})
ProTip! Use n and p to navigate between commits in a pull request.