Opened on 08/12/2018 at 08:41:47 AM

Closed on 08/29/2019 at 05:43:52 PM

#6857 closed defect (rejected)

SpecialSubscription objects are never removed

Reported by: mjethani Assignee:
Priority: P3 Milestone:
Module: Core Keywords: closed-in-favor-of-gitlab
Cc: kzar, jsonesen, hfiguiere, sebastian, greiner Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29854572/

Description (last modified by mjethani)

Environment

Adblock Plus browser extension as of changeset a87d009836da on Chrome (macOS 10.12.6)

How to reproduce

  1. Build the Adblock Plus browser extension from source and load it as an unpacked extension
  2. Open DevTools for the background page and take a heap snapshot
  3. Search for "SpecialSubscription" in the heap snapshot and note down the number of SpecialSubscription objects (could be zero if this is a fresh install)
  4. Open the options page and add the filter !foo to the "My filters" box
  5. Take another heap snapshot and note down the number of SpecialSubscription objects as in step 3
  6. Delete the filter !foo from "My filters" and save the changes
  7. Add a new filter !bar to "My filters"
  8. Take another heap snapshot and note down the number of SpecialSubscription objects as in step 3

Observed behaviour

If the number of SpecialSubscription objects in memory in step 5 is N, the number of object in step 8 is N + 1. Neither reloading the extension nor restarting the browser changes anything. Over time, this can grow to a large number and likely slow down the performance of the extension.

Expected behaviour

The number of SpecialSubscription objects in memory in step 8 should be N. A subscription once removed should be deleted entirely.

Additional notes

The changes for #6855 do not fix this.

Hints for testers

This is still a work in progress, but for changeset c767cbd74705, this would be a good test:

  1. Fresh install of ABP
  2. On the options page, go to "My filters" and add a custom filter, and save the changes
  3. Now remove the filter and save the changes
  4. Add a new filter once again and save the changes
  5. Reload the extension and open the options page again

Expected: The last saved filter should still be there.

Attachments (0)

Change History (17)

comment:1 Changed on 08/12/2018 at 08:42:36 AM by mjethani

  • Cc kzar jsonesen hfiguiere added

comment:2 Changed on 08/12/2018 at 08:43:24 AM by mjethani

  • Cc sebastian added

comment:3 Changed on 08/12/2018 at 08:47:33 AM by mjethani

For what it's worth, on my machine I have 46 SpecialSubscription objects.

comment:4 Changed on 08/12/2018 at 08:51:13 AM by mjethani

  • Cc greiner added

comment:5 follow-up: Changed on 08/12/2018 at 09:39:19 AM by mjethani

Why does the concept of filter "groups" exists at all? In the extension UI all of the user's filters are in one text box. In core they are split up into multiple "groups" (different SpecialSubscription objects for elemhide, blocking, and so on). What's worse is that if there is no default group for a filter type, such as a comment filter, then it ends up in an entirely new SpecialSubscription all by itself.

comment:6 in reply to: ↑ 5 Changed on 08/12/2018 at 09:51:15 AM by mjethani

Replying to mjethani:

What's worse is that if there is no default group for a filter type, such as a comment filter, then it ends up in an entirely new SpecialSubscription all by itself.

Filed #6858 for this.

comment:7 Changed on 08/12/2018 at 10:31:48 AM by mjethani

  • Review URL(s) modified (diff)

Added a tentative fix.

comment:8 Changed on 08/24/2018 at 03:46:49 PM by greiner

Just for reference, I've posted my findings on the purpose of special subscription groups at 8:ticket:6859.

comment:9 Changed on 09/02/2018 at 05:06:03 PM by jsonesen

  • Owner set to jsonesen

comment:10 Changed on 10/01/2018 at 04:17:55 AM by jsonesen

Heh, I set myself as the owner but I also see you have the quick fix in review is that review blocked by something?

comment:11 Changed on 10/03/2018 at 01:28:51 PM by mjethani

Jon, yes, I have a quick fix for this. It doesn't entirely fix the issue, so you could keep this assigned to yourself for the proper fix.

comment:12 Changed on 10/03/2018 at 04:00:31 PM by abpbot

A commit referencing this issue has landed:
Issue 6857 - Do not serialize empty special subscriptions

comment:13 Changed on 10/03/2018 at 04:05:22 PM by mjethani

  • Description modified (diff)

comment:14 Changed on 10/17/2018 at 01:58:08 AM by jsonesen

  • Owner jsonesen deleted

comment:15 Changed on 02/07/2019 at 03:23:32 AM by abpbot

A commit referencing this issue has landed:
Issue 6857 - Do not serialize empty special subscriptions

comment:16 Changed on 02/21/2019 at 10:12:10 AM by ukacar

  • Verified working set

comment:17 Changed on 08/29/2019 at 05:43:52 PM by sebastian

  • Keywords closed-in-favor-of-gitlab added
  • Resolution set to rejected
  • Status changed from new to closed

Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.

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 (none).
 
Note: See TracTickets for help on using tickets.