-
Notifications
You must be signed in to change notification settings - Fork 862
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
bug: Ensure usage pings sent on browser upgrade #5635
Conversation
Usage pings block on initialization. Since we changed the preference for referral initialization, users upgrading to the newest version won't initialize with referral server since the kReferralInitialization will always be set to false. Fallback and also send usage ping if kReferralCheckedForPromoCodeFile is set.
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.
LGTM
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.
++
@@ -79,7 +79,8 @@ void BraveStatsUpdater::Start() { | |||
DCHECK(!server_ping_startup_timer_); | |||
server_ping_startup_timer_ = std::make_unique<base::OneShotTimer>(); | |||
#if BUILDFLAG(ENABLE_BRAVE_REFERRALS) | |||
if (pref_service_->GetBoolean(kReferralInitialization)) { | |||
if (pref_service_->GetBoolean(kReferralInitialization) || | |||
pref_service_->GetBoolean(kReferralCheckedForPromoCodeFile)) { |
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.
@simonhong does this look correct? @keur was mentioning you had found this in the original PR
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.
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.
Yes, this change seems correct because kReferralInitialization
is only set to true for new installs.
If kReferralCheckedForPromoCodeFile
is set, kReferralInitialization
is remained as false.
As description stated, all installs before kReferralInitialization
is introduce, we should check kReferralCheckedForPromoCodeFile
.
Verified using:
Scenario 1 (Upgrade case w/ non-default promo code):
Scenario 2 (Upgrade case with default promo code):
Scenario 3 (Clean install of 1.10.x):
|
Fixes brave/brave-browser#9921
Usage pings block on initialization. Since we changed the preference for
referral initialization, users upgrading to the newest version won't
initialize with referral server since the kReferralInitialization will
always be set to false. Fallback and also send usage ping if
kReferralCheckedForPromoCodeFile is set.
Resolves
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.