-
Notifications
You must be signed in to change notification settings - Fork 891
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 favicon image for verified youtube publishers #1649
Conversation
dbe9211
to
320b548
Compare
publisher_info_statement.Run(); | ||
|
||
std::string favicon = info.favicon_url; | ||
if (!favicon.empty()) { |
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.
because we have race condition (multiple requests try to update publisher info) we could be overriding already fetched favicon with an empty string (string is empty, because fetch was canceled and default value in struct for favicon is empty string). So we need to be carful when to update favicon.
sql::Statement publisher_info_statement( | ||
GetDB().GetCachedStatement(SQL_FROM_HERE, | ||
"INSERT OR REPLACE INTO publisher_info " | ||
"(publisher_id, verified, excluded, " | ||
"name, url, provider, favIcon) " | ||
"VALUES (?, ?, ?, ?, ?, ?, ?)")); | ||
"VALUES (?, ?, ?, ?, ?, ?, " | ||
"(SELECT IFNULL( " |
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.
if publisher doesn't exist we need to default favicon to empty string
320b548
to
37fd855
Compare
@@ -220,7 +220,7 @@ void BatPublishers::saveVisitInternal( | |||
publisher_info->favicon_url = fav_icon; | |||
} | |||
} else { | |||
publisher_info->favicon_url = std::string(); | |||
publisher_info->favicon_url = ledger::clear_favicon; |
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.
we need to force clear if user is not verified
37fd855
to
986aa50
Compare
Fixes favicon image for verified youtube publishers
Fixes favicon image for verified youtube publishers
Resolves brave/brave-browser#3324
Submitter Checklist:
npm test brave_unit_tests && npm test brave_browser_tests
) ongit rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist: