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): |
Description (last modified by mjethani)
Environment
Adblock Plus browser extension as of changeset a87d009836da on Chrome (macOS 10.12.6)
How to reproduce
- Build the Adblock Plus browser extension from source and load it as an unpacked extension
- Open DevTools for the background page and take a heap snapshot
- Search for "SpecialSubscription" in the heap snapshot and note down the number of SpecialSubscription objects (could be zero if this is a fresh install)
- Open the options page and add the filter !foo to the "My filters" box
- Take another heap snapshot and note down the number of SpecialSubscription objects as in step 3
- Delete the filter !foo from "My filters" and save the changes
- Add a new filter !bar to "My filters"
- 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:
- Fresh install of ABP
- On the options page, go to "My filters" and add a custom filter, and save the changes
- Now remove the filter and save the changes
- Add a new filter once again and save the changes
- 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
comment:4 Changed on 08/12/2018 at 08:51:13 AM by mjethani
- Cc greiner added
comment:5 follow-up: ↓ 6 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: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.
For what it's worth, on my machine I have 46 SpecialSubscription objects.