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

Optimize timers for publisher lists #9441

Closed
NejcZdovc opened this issue Apr 24, 2020 · 1 comment · Fixed by brave/brave-core#5356
Closed

Optimize timers for publisher lists #9441

NejcZdovc opened this issue Apr 24, 2020 · 1 comment · Fixed by brave/brave-core#5356

Comments

@NejcZdovc
Copy link
Contributor

NejcZdovc commented Apr 24, 2020

When users disable rewards we don't clear the interval. This means that publisher list will be downloaded next time even if rewards are off. This is because we don't check if rewards enabled on timers. This is not a problem for users that never enabled rewards/clean profiles.

@NejcZdovc NejcZdovc added this to the 1.10.x - Nightly milestone Apr 24, 2020
@NejcZdovc NejcZdovc self-assigned this Apr 24, 2020
NejcZdovc added a commit to brave/brave-core that referenced this issue Apr 24, 2020
NejcZdovc added a commit to brave/brave-core that referenced this issue Apr 24, 2020
NejcZdovc added a commit to brave/brave-core that referenced this issue Apr 24, 2020
NejcZdovc added a commit to brave/brave-core that referenced this issue Apr 24, 2020
@bsclifton bsclifton added OS/Android Fixes related to Android browser functionality OS/Desktop labels Apr 24, 2020
@kjozwiak
Copy link
Member

kjozwiak commented Apr 28, 2020

Verification PASSED on macOS 10.15.4 x64 using the following build:

Brave | 1.8.85 Chromium: 81.0.4044.122 (Official Build) (64-bit)
-- | --
Revision | 44f4233f08910d83b146130c1938256a2e05b136-refs/branch-heads/4044@{#963}
OS | macOS Version 10.15.4 (Build 19E287)
  • enabled rewards via the rewards panel and ensured that the publisher list was downloaded.
  • disabled rewards via brave://rewards and closed Brave
  • edited server_publisher_list_stamp under preferences and moved it back ~3 days
  • restarted the browser several times and ensured that the publisher list isn't being downloaded
  • enabled rewards and ensured that the publisher list was downloaded without any issues

Example of publisher list being downloaded after enabling rewards:

[ RESPONSE - OnDownload ]
> time: 1588040094
> 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: 1561
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 19006799
> headers content-type: application/json; charset=utf-8
> headers date: Tue, 28 Apr 2020 02:14:53 GMT
> headers etag: W/"cd3c678094a8b205d71bd20eb1477483"
> 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: 0b9c3bc2-ee67-401d-8e80-d96ae1f129c8
> headers x-runtime: 2.940268
> headers x-served-by: cache-yyz4527-YYZ
[ END RESPONSE ]

Verification passed on

Brave 1.8.85 Chromium: 81.0.4044.122 (Official Build) (64-bit)
Revision 44f4233f08910d83b146130c1938256a2e05b136-refs/branch-heads/4044@{#963}
OS Windows 10 OS Version 1803 (Build 17134.1006)
  • enabled rewards via the rewards panel and ensured that the publisher list was downloaded.
  • disabled rewards via brave://rewards and closed Brave
  • edited server_publisher_list_stamp under preferences and moved it back ~3 days
  • restarted the browser several times and ensured that the publisher list isn't being downloaded
  • enabled rewards and ensured that the publisher list was downloaded without any issues

Example of publisher list being downloaded after enabling rewards:

[ RESPONSE - OnDownload ]
> time: 1588073906
> 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: 358
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 19033260
> headers content-type: application/json; charset=utf-8
> headers date: Tue, 28 Apr 2020 11:34:35 GMT
> headers etag: W/"badde5f9b5a50b7a9ae683a56cb877d5"
> headers server: Cowboy
> headers status: 200
> headers vary: Accept-Encoding
> headers via: 1.1 varnish
> headers x-cache: HIT
> headers x-cache-hits: 30
> headers x-frame-options: deny
> headers x-request-id: 6cf80531-c397-45e4-b7f9-7428a3cb3d44
> headers x-runtime: 2.077662
> headers x-served-by: cache-bom18226-BOM
[ END RESPONSE ]

Verification passed on

Brave 1.8.85 Chromium: 81.0.4044.122 (Official Build) (64-bit)
Revision 44f4233f08910d83b146130c1938256a2e05b136-refs/branch-heads/4044@{#963}
OS Ubuntu 18.04 LTS
  • enabled rewards via the rewards panel and ensured that the publisher list was downloaded.
  • disabled rewards via brave://rewards and closed Brave
  • edited server_publisher_list_stamp under preferences and moved it back ~3 days
  • restarted the browser several times and ensured that the publisher list isn't being downloaded
  • enabled rewards and ensured that the publisher list was downloaded without any issues

Example of publisher list being downloaded after enabling rewards:

[ RESPONSE - OnDownload ]
> time: 1588097593
> 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: 3130
> headers cache-control: max-age=3600, public
> headers content-encoding: gzip
> headers content-length: 19042981
> headers content-type: application/json; charset=utf-8
> headers date: Tue, 28 Apr 2020 18:13:10 GMT
> headers etag: W/"f3924eb0fef1f593895bbd17ec4ebcf0"
> 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: b0c3523c-0ba1-47e7-8b31-4b14721d7826
> headers x-runtime: 3.037914
> headers x-served-by: cache-hhn4054-HHN
[ END RESPONSE ]

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

Successfully merging a pull request may close this issue.

6 participants