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

Change publisher list interval from 1 to 3 days #5129

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Apr 1, 2020

Resolves brave/brave-browser#8955

Submitter Checklist:

Test Plan:

  • clean profile
  • start browser
  • enable rewards
  • wait for publisher list to be inserted (you can check it in db)
  • close browser
  • change timestamp of server_publisher_list_stamp in Preference file back for 1 day
  • open browser again and make sure that you don't see publisher list download happening
  • close browser
  • change timestamp of server_publisher_list_stamp in Preference file back for 3 days
  • open browser again and make sure that publisher list now downloads again

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.

@NejcZdovc NejcZdovc added this to the 1.8.x - Nightly milestone Apr 1, 2020
@NejcZdovc NejcZdovc requested a review from a team April 1, 2020 05:17
@NejcZdovc NejcZdovc self-assigned this Apr 1, 2020
@NejcZdovc NejcZdovc requested a review from bsclifton April 1, 2020 05:17
@@ -34,7 +34,7 @@ const std::vector<std::string> kOnlyAnonWalletCountries = {

const std::map<std::string, uint64_t> kUInt64Options = {
{ledger::kOptionPublisherListRefreshInterval,
base::Time::kHoursPerDay * base::Time::kSecondsPerHour}
7* base::Time::kHoursPerDay * base::Time::kSecondsPerHour}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mobile should be on 7 days

@@ -141,9 +141,6 @@ static const uint64_t _milliseconds_minute = 60 * 1000;

static const uint64_t _milliseconds_second = 1000;

// 24 hours in seconds
static const uint64_t _publishers_list_load_interval = 24 * 60 * 60;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing as we don't use it anymore

@NejcZdovc
Copy link
Contributor Author

CI failed on un related things

@kjozwiak
Copy link
Member

kjozwiak commented Apr 2, 2020

Verification PASSED on macOS 10.15.3 x64 Catalina using the following build:

Brave | 1.8.61 Chromium: 81.0.4044.83 (Official Build) nightly (64-bit)
-- | --
Revision | 5718ca617723806b9aacfb41108a0d911d1bde74-refs/branch-heads/4044@{#853}
OS | macOS Version 10.15.3 (Build 19D76)
  • ensured that the publisher list was downloaded on first launch and placed into server_publisher_info via publisher_info_db
  • changed server_publisher_list_stamp via Preferences to 1585724400
  • restarted Brave and ensured that Publisher list wasn't being downloaded
  • changed server_publisher_list_stamp via Preferences to 1585378800

Example of Publisher List being downloaded after moving server_publisher_list_stamp three days back:

[ RESPONSE - OnDownload ]
> time: 1585807800
> result: Success
> http code: 200
> response: Publisher list
> headers accept-ranges: bytes
> headers access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
> headers access-control-allow-methods: GET
> headers access-control-allow-origin: https://rewards.bravesoftware.com
> headers access-control-request-method: GET
> headers age: 3392
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 16931839
> headers content-type: application/json; charset=utf-8
> headers date: Thu, 02 Apr 2020 06:09:58 GMT
> headers etag: W/"f0eca12d54cdfe349c6e71380306fe54"
> headers server: Cowboy
> headers status: 200
> headers strict-transport-security: max-age=31536000; includeSubDomains
> headers vary: Accept-Encoding
> headers via: 1.1 varnish
> headers x-cache: HIT
> headers x-cache-hits: 0
> headers x-frame-options: deny
> headers x-request-id: fb7d5271-2a70-4997-a357-52a5c14a6a81
> headers x-runtime: 2.010515
> headers x-served-by: cache-yyz4547-YYZ
[ END RESPONSE ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-ios Do not run CI builds for iOS feature/rewards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change publisher list fetch interval
4 participants