Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#430 closed defect (fixed)

Filter hit counters aren't cleared

Reported by: Berroll Assignee: saroyanm
Priority: P2 Milestone: Adblock-Plus-2.6.4-for-Firefox
Module: Adblock-Plus-for-Firefox Keywords:
Cc: smultron45@…, trev Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):



I'm using Adblock Plus version 2.6 in Firefox 24.5.0 ESR (Ubuntu GNU/Linux 12.04.4 LTS).
I use RuAdList+EasyList, Fanboy Social Blocklist, EasyPrivacy and some custom filters.

How to reproduce

When I open Filter Settings > Personal Filters, select all my custom filters and use "Clear hit counters" (sorry if the menu names aren't correct as I'm translating from Russian), the counters are cleared and show all zeroes.

Observed behaviour

When I restart Firefox and open the same settings tab, all my counters are restored back with the same numbers which were shown before clearing them.

Expected behaviour

The counters should remain cleared so I can see which filters aren't used anymore and remove them.

I also tried clearing these counters separately, not all together, but after browser restart they revert back to their former state.

Change History (12)

comment:1 Changed 6 years ago by philll

  • Priority changed from Unknown to P2
  • Ready set

I cannot reproduce your issue exactly, but i noticed that the custom filter hits are 1 instead of 0 after a Firefox restart without having visited any page after clearing.

comment:2 Changed 6 years ago by sebastian

  • Component changed from Unknown to Adblock-Plus-for-Firefox

comment:3 Changed 6 years ago by beelzy

I was able to reproduce this problem and find out why. Apparently, resetHitCounter is counted as a 'hitCount' action, so setDirty is only increased by 0.002, which is not enough to call SaveToDisk (unless you wait long enough or remove enough entries or setDirty is already high enough). You can still reset the hit counters by clearing the history as a workaround until this gets fixed. This problem also appears to affect subscription filters.

My suggestion would be to make resetHitCount have its own action, or give it another one that exists and requires the same behavior or call SaveToDisk when you click on the close button. I know this isn't tagged as goodfirstbug, so I'm unsure if you want me to work on this, but that's what I found out about it.

comment:4 Changed 6 years ago by mapx

  • Cc smultron45@… added

comment:5 Changed 6 years ago by trev

  • Cc trev added

Yes, hit counts are generally not considered important enough to trigger saving to disk immediately. When clearing all hit counts we call FilterListener.setDirty(0); explicitly because of that, we might want to do it here as well - or just make FilterStorage.resetHitCounts() always do it.

comment:6 Changed 6 years ago by mapx

unfortunately it's not only about hits but all other settings (filter subscriptions, custom filters)

comment:7 Changed 6 years ago by trev

Not the same issue. Hit counts not being saved immediately is expected, other data - not so much.

comment:8 Changed 6 years ago by saroyanm

  • Owner set to saroyanm

comment:9 Changed 6 years ago by saroyanm

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:10 Changed 6 years ago by saroyanm

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:11 Changed 6 years ago by trev

  • Milestone set to Adblock-Plus-for-Firefox-next
  • Platform set to Firefox/Firefox Mobile

comment:12 Changed 5 years ago by philll

  • Platform changed from Firefox/Firefox Mobile to Firefox

Made Firefox and Firefox mobile available as seperate platforms.

Note: See TracTickets for help on using tickets.