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 list improvements #5301

Merged
merged 5 commits into from
Apr 22, 2020
Merged

Publisher list improvements #5301

merged 5 commits into from
Apr 22, 2020

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Apr 21, 2020

Resolves brave/brave-browser#9376

Submitter Checklist:

Test Plan:

  • clean profile (do it with production)
  • enable rewards
  • go to db file and make sure that publisher data from the server is there
  • visit https://brave.com/ and make sure that you see custom banner

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 marked this pull request as ready for review April 21, 2020 21:05
@NejcZdovc
Copy link
Contributor Author

Restarting Windows as it failed on unrelated stuff

@NejcZdovc NejcZdovc added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels Apr 22, 2020
@NejcZdovc NejcZdovc requested a review from a team April 22, 2020 06:04
@NejcZdovc NejcZdovc force-pushed the publisher-list-improvments branch 2 times, most recently from d373064 to f7248e9 Compare April 22, 2020 06:25
@NejcZdovc NejcZdovc added this to the 1.10.x - Nightly milestone Apr 22, 2020
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM, just one minor comment

@@ -208,8 +208,9 @@ void DatabaseServerPublisherBanner::InsertOrUpdateList(
"VALUES (?, ?, ?, ?, ?)",
kTableName);

ledger::DBCommandPtr command;
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a reason for pulling this variable out of the loop?

@kjozwiak
Copy link
Member

Verification PASSED on macOS 10.15.3 x64 using the following build:

Brave | 1.10.3 Chromium: 81.0.4044.113 (Official Build) nightly (64-bit)
-- | --
Revision | e3225dafb0475864a1812a374d73a92e391635ac-refs/branch-heads/4044@{#936}
OS | macOS Version 10.15.3 (Build 19D76)

Verified that the Publisher List was being downloaded without any issues once brave://rewards was enabled:

[ RESPONSE - OnDownload ]
> time: 1587586315
> 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: 2207
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 18452120
> headers content-type: application/json; charset=utf-8
> headers date: Wed, 22 Apr 2020 20:11:54 GMT
> headers etag: W/"52145fabb213314e5a845e288a185216"
> 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: fd7138c9-a631-46b1-937a-14f5305b7691
> headers x-runtime: 5.987030
> headers x-served-by: cache-yyz4549-YYZ
[ END RESPONSE ]

Ensured that brave.com, chess.com and kjozwiak.github.com appeared as verified and displayed the custom banners without any issues.

brave.com example:

Screen Shot 2020-04-22 at 4 15 42 PM

Screen Shot 2020-04-22 at 4 15 50 PM

chess.com example:

Screen Shot 2020-04-22 at 4 16 02 PM

Screen Shot 2020-04-22 at 4 16 13 PM

kjozwiak.github.io example:

Screen Shot 2020-04-22 at 4 16 58 PM

Screen Shot 2020-04-22 at 4 17 06 PM

Also checked and ensured that the server_publisher_info database was populated as per the following:

Screen Shot 2020-04-22 at 4 15 35 PM

Ensured that publisher_info was populated whenever you visited a website:

Screen Shot 2020-04-22 at 4 17 21 PM

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

Successfully merging this pull request may close these issues.

Improve publisher list insert time/memory/cpu
5 participants