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

Do not show 0% after normalization #2428

Merged
merged 1 commit into from
May 14, 2019
Merged

Do not show 0% after normalization #2428

merged 1 commit into from
May 14, 2019

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented May 13, 2019

Resolves brave/brave-browser#4386

Submitter Checklist:

Test Plan:

  • enable rewards
  • add couple of sites so that some publishers will have % 0
  • open rewards page
  • click on all sites
  • make sure that you don't see 0 % publishers
  • open new window
  • start watching youtube video
  • make sure that after 2min of the video you still don't see 0 % publishers in all sites modal

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.

Copy link
Collaborator

@tmancey tmancey left a comment

Choose a reason for hiding this comment

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

LGTM++

@tmancey tmancey self-requested a review May 13, 2019 19:21
Copy link
Collaborator

@tmancey tmancey left a comment

Choose a reason for hiding this comment

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

LGTM++ (security tests are failing which look unrelated but please check before merging)

@NejcZdovc NejcZdovc merged commit 4b19e24 into master May 14, 2019
@NejcZdovc NejcZdovc deleted the exclude-0 branch May 14, 2019 06:20
@@ -2829,7 +2829,9 @@ void RewardsServiceImpl::OnPublisherListNormalizedSaved(

ContentSiteList site_list;
for (auto& publisher : *list) {
site_list.push_back(PublisherInfoToContentSite(publisher));
if (publisher.percent >= 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is the right place to do this. This is UI logic and should be filtered by the UI, not by RewardsServiceImpl

Copy link
Collaborator

Choose a reason for hiding this comment

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

also there should be a test for this

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 was added here as other (sort is here as well) that is then sent to UI. Left comment here how I want to solve it https://github.com/brave/brave-core/pull/2432/files#r283678712

Copy link
Collaborator

@bridiver bridiver May 15, 2019

Choose a reason for hiding this comment

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

The sort is also here which is UI, but I think even short-term it would be better to move both of those to the UI class OnPublisherListNormalized observer method. I think we're all on the same page now that we should be doing the calculations at query time and dumping the serialized normalization? If not let's discuss in slack with @tmancey as well

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.

Normalize callback should exclude 0% publishers
3 participants