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

Publisher updates flow #1457

Merged
merged 6 commits into from
Feb 1, 2019
Merged

Publisher updates flow #1457

merged 6 commits into from
Feb 1, 2019

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jan 25, 2019

Resolves brave/brave-browser#2973
Resolves brave/brave-browser#3015
Resolves brave/brave-browser#3135

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

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

void LedgerImpl::SetPublisherInfo(std::unique_ptr<ledger::PublisherInfo> info,
ledger::PublisherInfoCallback callback) {
uint64_t window_id) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we get rid of the callback, how does the caller find out about errors?

void RewardsServiceImpl::OnNormalizedPublisherListSaved(
std::unique_ptr<ledger::PublisherInfoList> list) {
if (!list) {
LOG(ERROR) << "Problem saving normalized publishers "
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can't just log this error and ignore it here, SaveNormalizedPublisherList needs a callback

Copy link
Contributor Author

@NejcZdovc NejcZdovc Jan 28, 2019

Choose a reason for hiding this comment

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

sure, we can add callback to go back to native ledger. What should we do in native ledger with this callback?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what we were doing with save publisher actions was redirecting callback to dummy one

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

see below

Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

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

Pertaining to:

brave/brave-browser#3015
brave/brave-browser#3135

Both issues were addressed. A general smoke test of Rewards (adding sites to a-c, removal and restoration) produced no unexpected behavior or errors. This is now just awaiting a final look from brian j and a rebase. Good work!

@NejcZdovc
Copy link
Contributor Author

rebased, cc @bridiver for a final review

@@ -82,7 +82,11 @@ export const rewardsPanelReducer = (state: RewardsExtension.State | undefined, a
const id = getWindowId(tab.windowId)
const publishers: Record<string, RewardsExtension.Publisher> = state.publishers
const publisher = publishers[id]
chrome.braveRewards.getPublisherData(tab.windowId, tab.url, tab.favIconUrl || '', payload.publisherBlob || '')

if ((payload.onlyDiff && publisher && publisher.tabUrl !== tab.url) || !payload.onlyDiff) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be causing problems with getting media publishers in panel

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 is working as expected, fix for the panel not working #2178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants