Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Promotions server should now be polled from payments screen without having payments enabled. #14732

Merged
merged 1 commit into from
Jul 14, 2018
Merged

Promotions server should now be polled from payments screen without having payments enabled. #14732

merged 1 commit into from
Jul 14, 2018

Conversation

jasonrsadler
Copy link
Contributor

@jasonrsadler jasonrsadler commented Jul 13, 2018

Addon fix for #14616
Fixes notification breaks from #14621

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).
  • 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. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

  • Start Brave with LEDGER_VERBOSE=true
  • Ensure promotion url calls do not occur until between 45 and 60 seconds after Brave startup (Look for requests to v1/grants).

Whether payments is enabled or not, UGP polling should still be present in console when navigating to about:preferences#payments and LEDGER_VERBOSE=true

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@jasonrsadler jasonrsadler self-assigned this Jul 13, 2018
@jasonrsadler jasonrsadler changed the title Promotions server should now be polled from payments screen without having payments enabled. Promotions server should now be polled from payments screen without having payments enabled. 🐛 Jul 13, 2018
@jasonrsadler jasonrsadler changed the title Promotions server should now be polled from payments screen without having payments enabled. 🐛 Promotions server should now be polled from payments screen without having payments enabled. Jul 13, 2018
appActions.onPromotionGet()
clearTimeout(togglePromotionTimeoutId)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Let's wrap this in an if statement (if (togglePromotionTimeoutId))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh! Not a nit for me. Thanks.

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.

Looks good to me, test plan works. One comment left

@jasonrsadler jasonrsadler requested a review from ryanml July 13, 2018 22:54
ryanml
ryanml previously approved these changes Jul 13, 2018
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.

++

@jasonrsadler
Copy link
Contributor Author

Enable wallet notification is remaining and stacking with promo notification. Reverting to wip.

…aving payments enabled.

Added tests ✅

Updated clearing timeout with null check.

Reworked UGP promo server poll delay. Removed appActions 🔥
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.

Not seeing the stacking issue, lgtm

@jasonrsadler jasonrsadler merged commit 7cb4060 into brave:master Jul 14, 2018
jasonrsadler pushed a commit that referenced this pull request Jul 14, 2018
Promotions server should now be polled from payments screen without having payments enabled.
jasonrsadler pushed a commit that referenced this pull request Jul 14, 2018
Promotions server should now be polled from payments screen without having payments enabled.
@jasonrsadler
Copy link
Contributor Author

master: 7cb4060
0.23.x: cbd9a0e
0.24.x: 600d7c3

@jasonrsadler jasonrsadler deleted the fix/#14616-ugp-boot-addendum branch July 14, 2018 21:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants