Opened on 05/06/2014 at 08:20:14 AM

Closed on 06/13/2014 at 09:31:03 AM

Last modified on 05/20/2015 at 02:22:39 PM

#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@gmail.com, trev Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/5373553692114944/

Description

Environment

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.

Attachments (0)

Change History (12)

comment:1 Changed on 05/16/2014 at 10:01:19 AM 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 on 05/16/2014 at 11:11:36 AM by sebastian

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

comment:3 Changed on 05/20/2014 at 04:05:49 PM 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 on 05/21/2014 at 08:45:42 AM by mapx

  • Cc smultron45@gmail.com added

comment:5 Changed on 05/21/2014 at 08:53:24 AM 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 on 05/21/2014 at 08:55:46 AM by mapx

unfortunately it's not only about hits but all other settings (filter subscriptions, custom filters)
see
https://issues.adblockplus.org/ticket/513

comment:7 Changed on 05/21/2014 at 09:02:25 AM by trev

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

comment:8 Changed on 06/09/2014 at 10:46:32 AM by saroyanm

  • Owner set to saroyanm

comment:9 Changed on 06/09/2014 at 11:23:06 AM by saroyanm

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

comment:10 Changed on 06/13/2014 at 09:31:03 AM by saroyanm

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

comment:11 Changed on 07/15/2014 at 04:54:16 PM by trev

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

comment:12 Changed on 05/20/2015 at 02:22:39 PM by philll

  • Platform changed from Firefox/Firefox Mobile to Firefox

Made Firefox and Firefox mobile available as seperate platforms.

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from saroyanm.
 
Note: See TracTickets for help on using tickets.