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

Obtains the Publisher/Content Creators portrait image to use for the BAT panel favicon #3464

Closed
wants to merge 2 commits into from

Conversation

masparrow
Copy link
Contributor

@masparrow masparrow commented Sep 18, 2019

Resolves brave/brave-browser#5720

Submitter Checklist:

Test Plan:

(With a clean install, or an existing install and using a previously unvisited Vimeo publisher)

  1. Navigate to a connected & verified vimeo publisher.
  2. Open panel, view the favicon displayed in panel.
  3. View a video so that it gets added to your AC table.
  4. Tip the publisher.
  5. See same favicon on Tip and AC tables.

Nb. with existing (real world) installs, previously visited publishers will still have the wrong favicon, as it is cached. A separate ticket will be raised to resolve this.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@masparrow masparrow self-assigned this Sep 18, 2019
@masparrow masparrow added this to the 0.72.x - Nightly milestone Sep 18, 2019
@masparrow masparrow requested a review from a team September 18, 2019 11:54
@NejcZdovc NejcZdovc changed the title Obtains the Publisher/Content Creators portrait image to use for the … Obtains the Publisher/Content Creators portrait image to use for the BAT panel favicon Sep 18, 2019
@masparrow masparrow force-pushed the issues/5720 branch 2 times, most recently from b219e49 to 879a529 Compare September 19, 2019 09:25
Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

There is one regression compares to master:

Steps:

master: Displays publisher with wrong img
this PR: Doesn't display publisher (or display it with a big delay). If it's displayed logo is not displayed
image

@masparrow
Copy link
Contributor Author

There is one regression compares to master:

Steps:

master: Displays publisher with wrong img
this PR: Doesn't display publisher (or display it with a big delay). If it's displayed logo is not displayed
image
@NejcZdovc how did you test with willchristansen as a verified creator, as he's showing as 'Not yet verified' for me. TIA!

@NejcZdovc
Copy link
Contributor

@masparrow switch to production and it will be verified

publisher_info->favicon_url = ledger::kClearFavicon;
if (publisher_info->favicon_url.empty()) {
publisher_info->favicon_url = ledger::kClearFavicon;
}
Copy link
Contributor Author

@masparrow masparrow Sep 26, 2019

Choose a reason for hiding this comment

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

During a page load, we save the pub info a lot. At one point during the page load/parse, we have a valid favicon url, but at a later point, it is empty as it cannot be parsed (at that point). If an empty URL is passed in and we already have a favicon, this change prevents us clearing the existing favicon url. Can anyone see a problem with this, as other paths than Vimeo will use the same logic flow...

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we would have a problem with this code as if we save some wrong url that is not stored in chromium favicon storage then we will never clear it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bear in mind if we do parse a URL, it will always be saved. Also - if we implement the favicon cache expiration we mentioned, it will eventually self-repair even if the above did happen. WDYT? (I've yet to test this against production BTW - the change is here for discussion only ATM)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Further - this doesn't seem to work anyway 🤔 which is a bit odd. The challenge ATM is that during the page scrape, the content doesn't have anything containing the Users portrait ID, so it ends up removing any prior Favicon.

@NejcZdovc NejcZdovc removed this from the 0.73.x - Dev milestone Nov 7, 2019
@@ -259,7 +259,9 @@ void Publisher::SaveVisitInternal(
publisher_info->favicon_url = fav_icon;
}
} else {
publisher_info->favicon_url = ledger::kClearFavicon;
if (publisher_info->favicon_url.empty()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should check for !is_verified and always clear if that is the case (discussed with @NejcZdovc)

@bsclifton
Copy link
Member

Closing as stale

@bsclifton bsclifton closed this Jun 18, 2020
@NejcZdovc NejcZdovc deleted the issues/5720 branch June 18, 2020 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

favicon for verified vimeo publisher is incorrect
3 participants