Closed
Bug 537189
Opened 15 years ago
Closed 15 years ago
nsIContentPrefService.removePrefsByName and .removeGroupedPrefs leave data behind
Categories
(Toolkit :: Preferences, defect)
Toolkit
Preferences
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a1
Tracking | Status | |
---|---|---|
status1.9.2 | --- | .9-fixed |
People
(Reporter: darktrojan, Assigned: darktrojan)
Details
(Whiteboard: [c-n 1.9.2])
Attachments
(1 file, 2 obsolete files)
6.38 KB,
patch
|
myk
:
review+
beltzner
:
approval1.9.2.2-
christian
:
approval1.9.2.9+
|
Details | Diff | Splinter Review |
The content pref service is leaving group names behind because it's calling _deleteGroupIfUnused with group names instead of IDs. Working on a patch/test now.
Flags: wanted1.9.2?
Assignee | ||
Comment 1•15 years ago
|
||
Attachment #419510 -
Flags: review?(myk)
Assignee | ||
Comment 2•15 years ago
|
||
Forgot to hg add before hg diff. How come I don't notice these things until I upload them and make a fool of myself?
Attachment #419510 -
Attachment is obsolete: true
Attachment #419511 -
Flags: review?(myk)
Attachment #419510 -
Flags: review?(myk)
Assignee | ||
Comment 3•15 years ago
|
||
Seems removeGroupedPrefs leaves unused setting names behind too. canOfWorms.open();
Attachment #419511 -
Attachment is obsolete: true
Attachment #419514 -
Flags: review?(myk)
Attachment #419511 -
Flags: review?(myk)
Assignee | ||
Updated•15 years ago
|
Summary: nsIContentPrefService.removePrefsByName leaves data behind → nsIContentPrefService.removePrefsByName and .removeGroupdPrefs leave data behind
Comment 4•15 years ago
|
||
Comment on attachment 419514 [details] [diff] [review] two fixes and tests Just back from vacation... nice catches! >+ this._dbConnection.executeSimpleSQL( >+ "DELETE FROM settings " + >+ "WHERE id NOT IN (SELECT DISTINCT settingID FROM prefs)" >+ ); This has a potential performance implication, since prefs.settingID is not indexed by itself, so this does a full table scan of the prefs table. We're dealing with relatively small datasets, so it may not matter, but we could make sure it doesn't by adding an index on the prefs.settingID column. (Either way, SQLite will still do a full scan of the settings table, since it can't use an index to resolve a term using a NOT IN operator.) > this._dbConnection.executeSimpleSQL("DELETE FROM prefs WHERE settingID = " + settingID); FWIW, the performance implication of the query added above applies to this existing query as well. >+ for (var i = 0; i < groupNames.length; i++) { >+ this._notifyPrefRemoved(groupNames[i], aName); >+ if (groupNames[i]) // ie. not null, which will be last (and i == groupIDs.length) >+ this._deleteGroupIfUnused(groupIDs[i]); It's unclear whether _deleteGroupIfUnused is more performant than a single |DELETE FROM groups WHERE id NOT IN (SELECT groupID FROM prefs)| after the loop would be. _deleteGroupIfUnused uses indexes on both the groups and prefs tables, but we run it multiple times, whereas the single query only runs once, but it does a full table scan of the groups table (it still uses an index for the prefs table). Barring determinative data, let's err on the side of multiple queries using indexes (i.e. the current implementation).
Attachment #419514 -
Flags: review?(myk) → review+
Assignee | ||
Updated•15 years ago
|
Attachment #419514 -
Flags: approval1.9.2.1?
Assignee | ||
Comment 5•15 years ago
|
||
Comment on attachment 419514 [details] [diff] [review] two fixes and tests Hopefully this will make it to 1.9.2 where removePrefsByName appears for the first time. Might as well not be buggy on debut, if we can avoid it.
Assignee | ||
Comment 6•15 years ago
|
||
I'm not too concerned about performance of this as I expect most users will have a very small dataset. Perhaps we should get some metrics (Test Pilot?) on CPS usage.
Keywords: checkin-needed
Comment 7•15 years ago
|
||
Pushed to m-c: http://hg.mozilla.org/mozilla-central/rev/80aca4165c6c.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Updated•15 years ago
|
Target Milestone: --- → mozilla1.9.3a1
Comment 8•14 years ago
|
||
Comment on attachment 419514 [details] [diff] [review] two fixes and tests Sorry that we missed this for the 1.9.2.2 cycle; had some more pressing regressions to get to. We'll be back to approve this (great) change for 1.9.2.3
Attachment #419514 -
Flags: approval1.9.2.3?
Attachment #419514 -
Flags: approval1.9.2.2?
Attachment #419514 -
Flags: approval1.9.2.2-
Updated•14 years ago
|
Attachment #419514 -
Flags: approval1.9.2.4? → approval1.9.2.8?
Comment 9•14 years ago
|
||
If I remember correctly, this fix has a privacy implication, since ContentPrefs::removeGroupedPrefs is used by the data sanitizer to remove site-specific preferences. Since 1.9.2 is going to be around for a while longer, it's worth getting this fix onto the branch.
Assignee | ||
Updated•14 years ago
|
Summary: nsIContentPrefService.removePrefsByName and .removeGroupdPrefs leave data behind → nsIContentPrefService.removePrefsByName and .removeGroupedPrefs leave data behind
Comment 10•14 years ago
|
||
Comment on attachment 419514 [details] [diff] [review] two fixes and tests a=LegNeato for 1.9.2.9.
Attachment #419514 -
Flags: approval1.9.2.9? → approval1.9.2.9+
Updated•14 years ago
|
Keywords: checkin-needed
Updated•14 years ago
|
Whiteboard: [c-n 1.9.2]
Updated•14 years ago
|
Attachment #419514 -
Flags: approval1.9.2.10?
Comment 11•14 years ago
|
||
Comment on attachment 419514 [details] [diff] [review] two fixes and tests http://hg.mozilla.org/releases/mozilla-1.9.2/rev/427a3286223e
Attachment #419514 -
Flags: approval1.9.2.10?
Updated•14 years ago
|
status1.9.2:
--- → .9-fixed
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Updated•13 years ago
|
Flags: wanted1.9.2?
You need to log in
before you can comment on or make changes to this bug.
Description
•