-
Notifications
You must be signed in to change notification settings - Fork 868
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
Fixes ads service will crash if a user previously had ads history and triggers OnUnIdle before Brave ads are initialized #3977
Conversation
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
Windows failed CI so restarting Windows build |
@@ -231,7 +231,7 @@ bool AdsImpl::IsInitialized() { | |||
void AdsImpl::Shutdown( | |||
ShutdownCallback callback) { | |||
if (!is_initialized_) { | |||
BLOG(WARNING) << "Failed to shutdown ads as not initialized"; | |||
BLOG(WARNING) << "Shutdown failed as not initialized"; |
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.
Better as (INFO)? It's fair to say you can't shut something down if it's not initialised, so really this is just diagnostic at this point to say something called it prematurely?
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.
Our logs are quite busy as is, so wanted to reduce noise. When diagnosing issues we use a higher verbosity.
@@ -342,6 +344,10 @@ void AdsImpl::OnUnIdle() { | |||
|
|||
BLOG(INFO) << "Browser state changed to unidle"; | |||
|
|||
if (!IsInitialized()) { | |||
return; |
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.
BLOG here perhaps? Or superfluous?
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.
Good point, adding now
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.
Fixed
… triggers OnUnIdle before Brave ads are initialized
Fixes brave/brave-browser#6880
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
See brave/brave-browser#6880 for steps
Reviewer Checklist:
After-merge Checklist:
changes has landed on.