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

Custom filter lists in Shields don't respect Expires: field #17909

Closed
Furax-31 opened this issue Sep 7, 2021 · 3 comments · Fixed by brave/brave-core#18836
Closed

Custom filter lists in Shields don't respect Expires: field #17909

Furax-31 opened this issue Sep 7, 2021 · 3 comments · Fixed by brave/brave-core#18836

Comments

@Furax-31
Copy link

Furax-31 commented Sep 7, 2021

Description

Custom filters don't update automatically

Actual result:

Custom filters don't update automatically. You have to force the update manually.

Expected result:

Filter lists should update automatically.

Reproduces how often:

Add a list manually, after 3 days it is still not updated

Desktop Brave version:

All nightly build since 1.31.16
@Furax-31 Furax-31 added OS/Android Fixes related to Android browser functionality OS/Desktop labels Sep 7, 2021
@antonok-edm
Copy link
Collaborator

@Furax-31 thanks for reporting! Given how recently the subscriptions feature landed, I imagine you're looking at a list with a shorter update interval specified. The lists should update automatically after 7 days. Unfortunately, at the moment, the browser doesn't check any of the list metadata, including the Expires field where a list maintainer can customize this interval - that's definitely planned as a followup improvement. There are some clever load-balancing algorithms in other adblockers which we'd probably want to respect as well (e.g. https://adblockplus.org/blog/downloading-a-file-regularly-how-hard-can-it-be).

I'll leave this issue open to track support for the Expires field, since I hadn't already opened one yet.

On the other hand, if the lists aren't updating soon after 7 days have passed, please let us know as well.

@antonok-edm antonok-edm added enhancement feature/shields/adblock Blocking ads & trackers with Shields labels Sep 7, 2021
@antonok-edm antonok-edm changed the title Custom filter lists in Shields doesn't update automatically Custom filter lists in Shields don't respect Expires: field Sep 7, 2021
@antonok-edm antonok-edm self-assigned this Sep 7, 2021
@brave-builds brave-builds added this to the 1.54.x - Nightly milestone Jun 15, 2023
@stephendonner stephendonner added QA/In-Progress Indicates that QA is currently in progress for that particular issue and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Jul 10, 2023
@stephendonner
Copy link

stephendonner commented Aug 5, 2023

Verification PASSED using

Brave | 1.57.36 Chromium: 115.0.5790.171 (Official Build) beta (x86_64)
-- | --
Revision | a4bb683f14dc402f5da13707e13559dc4d5ef08b
OS | macOS Version 11.7.9 (Build 20G1426)

Case 1 - PASSED

Steps:

  1. installed 1.57.36
  2. launched Brave
  3. opened brave://settings/shields/filters
  4. pasted https://raw.githubusercontent.com/miyurusankalpa/adblock-list-sri-lanka/master/lkfilter.txt into the Enter filter list URL textbox, and clicked Add
  5. closed Brave
  6. opened Local State from /Users/sdonner/Library/Application Support/BraveSoftware/Brave-Browser-Beta and confirmed expires is 120
  7. examined the values for last_successful_update_attempt and last_update_attempt, which were both 13335905915841497
  8. subtracted 417600000000 (from the example in the test plan) from the above 13335905915841497 and got 13335488315841497
  9. relaunched Brave
  10. confirmed 5 days ago timestamp in brave://settings/shields/filters
  11. waited 5 minutes
  12. confirmed the timestamp didn't update
  13. closed Brave
  14. subtracted 14,400,000,000 microseconds from 13335488315831497 and replaced the values for last_successful_update_attempt and last_update_attempt with 13335473915841497
  15. relaunched Brave
  16. confirmed timestamp still read 5 days ago
  17. waited 5 minutes
  18. confirmed timestamp refreshed with 0 seconds ago
step 4 step 6 step 7 step 8 steps 10-12 step 14 step 16 step 18
Screen Shot 2023-08-07 at 11 18 49 AM Screen Shot 2023-08-07 at 11 20 33 AM Screen Shot 2023-08-07 at 11 22 21 AM Screen Shot 2023-08-07 at 11 39 56 AM Screen Shot 2023-08-07 at 12 01 07 PM Screen Shot 2023-08-07 at 12 28 43 PM Screen Shot 2023-08-07 at 12 28 58 PM Screen Shot 2023-08-07 at 12 29 58 PM

Case 2 - PASSED

Steps:

  1. installed 1.57.36
  2. launched Brave
  3. opened brave://settings/shields/filters
  4. pasted https://raw.githubusercontent.com/miyurusankalpa/adblock-list-sri-lanka/master/lkfilter.txt into the Enter filter list URL textbox, and clicked Add
  5. closed Brave
  6. opened Local State from /Users/sdonner/Library/Application Support/BraveSoftware/Brave-Browser-Beta and confirmed expires is 120
  7. examined the values for last_successful_update_attempt and last_update_attempt, which were both 13335911840504428
  8. subtracted 431520000000 microseconds from 13335911840504428 to get 13335480320504428
  9. replaced the values in step 7 with 13335480320504428
  10. relaunched Brave
  11. waited, and noted 5 days ago last-updated timestamp
  12. after about a minute, confirmed the list auto-refreshed, with 0 seconds ago
step 4 step 6 step 7 step 9 step 11 step 12
Screen Shot 2023-08-07 at 12 45 35 PM Screen Shot 2023-08-07 at 12 48 28 PM Screen Shot 2023-08-07 at 1 14 16 PM Screen Shot 2023-08-07 at 1 11 59 PM Screen Shot 2023-08-07 at 1 05 03 PM Screen Shot 2023-08-07 at 1 05 58 PM

@stephendonner stephendonner added QA/In-Progress Indicates that QA is currently in progress for that particular issue QA Pass-macOS and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Aug 5, 2023
@Uni-verse
Copy link
Contributor

Uni-verse commented Aug 14, 2023

Verified on Samsung Galaxy S21 5G using version(s):

Brave	1.57.45 Chromium: 116.0.5845.82 (Official Build) (64-bit) 
Revision	c43241b101a636729252df90d1a1a7b72f2a9f94
OS	Android 13; Build/TP1A.220624.014; 33; REL

Note: QA to spot check custom filters/adblock list to ensure no regressions have occurred since the test plan in brave/brave-core#18836 (comment) cannot be tested on Android due to restricted access to file system.

  • Ensured using ||brave.com custom filter will disable js for brave.com
  • Ensured disabling shields will disable the custom filter list and re-enable js on brave.com
  • Ensured enabling Bypass Paywalls Clean Filters in adblock filters is removing paywall on nytimes.com`
Allow brave Brave.com blocking brave.com JS disabled Disabling shields restore site
Screenshot 2023-08-14 at 5 40 57 PM Screenshot 2023-08-14 at 5 41 11 PM Screenshot 2023-08-14 at 5 40 28 PM Screenshot 2023-08-14 at 5 39 28 PM Screenshot 2023-08-14 at 5 41 46 PM
Default Bypass paywall enabled With filter
Screenshot 2023-08-14 at 5 43 19 PM Screenshot 2023-08-14 at 5 56 40 PM Screenshot 2023-08-14 at 5 42 47 PM

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.

5 participants