Closed Bug 273311 Opened 20 years ago Closed 19 years ago

Deleting incoming account may delete unrelated accounts if ten or more accounts exist

Categories

(MailNews Core :: Backend, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tuukka.tolvanen, Assigned: tuukka.tolvanen)

References

Details

(Keywords: dataloss)

Attachments

(1 file, 1 obsolete file)

*sp3k deletes a deferred-to-global pop account in thunderbird, and
              sees "Would you like to subscribe to 9?" prompts and two
              unrelated accounts nuked in the process
        <sp3k> hahahaha
        <sp3k> no fucking way
        <sp3k> I deleted mail.server.server1, and it looks like it deleted
               mail.server.server1*
        *sp3k rofl
        <NeilAway> sp3k: oops
        <sp3k> probably just the prefs
        <sp3k> looks like it might have used the same logic for id1->id10 as
               well
        <NeilAway> yeah, that's what the code says to do :-(

Didn't try to reproduce, so this is somewhat hypothetical.

Steps to reproduce:
 1. Create ten or more incoming accounts
 2. Delete the first account
 3. Restart

Expected results: Only first account deleted.

Actual results: Other accounts (10--19 presumably) disappear after restart as well.

I deleted account1, whose identity is id1 and server is server1, so presumably
those prefs should have been deleted.

All account1, account10, account11, account12 (= last account),
    id1, id10 (= last id),
    server10, server11, server12 (= last server)
prefs were deleted as well.
(linux thunderbird aviary 2004-12-02-11Z.)
Attached patch aviary patch0 (obsolete) — Splinter Review
Patch against aviary, adds trailing dot "." to root pref in
nsMsgAccount/nsMsgIdentity/nsMsgIncomingServer/nsSmtpServer::ClearAllValues
before handing off to nsPref::EnumerateChilren or nsPrefBranch::GetChildList. I
tested that with this patch, deleting account1 drops account1.*, id1.*,
server1.* prefs in my prefs.

I suppose the proper fix would be for all of these to just use
nsPrefBranch::DeleteBranch, which is helpful enough to take care of the
dot-business at its end.
Assignee: sspitzer → t.bugz
Status: NEW → ASSIGNED
Attachment #167978 - Flags: superreview?(mscott)
Attachment #167978 - Flags: review?(neil.parkwaycc.co.uk)
Should this make 1.0?
effort - have patch
risk - the current patch looks very safe to me, but then... ;)
impact - low, you need to have >9 accounts and delete one
severity - dataloss, but only prefs, not actual mail or such
Flags: blocking-aviary1.0?
See bug 110841 for the 'Would you like to subscribe to 9?' bug...
(In reply to comment #2)
>I suppose the proper fix would be for all of these to just use
>nsPrefBranch::DeleteBranch, which is helpful enough to take care of the
>dot-business at its end.
Not true according to prefapi.cpp which suggests that once nsIPref is finally
removed from the codebase the dot will never be automatically appended.
Comment on attachment 167978 [details] [diff] [review]
aviary patch0

IIRC rootPref.Append('.'); is probably preferred here.

I commented in bug 226005 about the use of DeleteBranch.
Attachment #167978 - Flags: review?(neil.parkwaycc.co.uk) → review+
Flags: blocking-aviary1.0?
Attachment #167978 - Flags: superreview?(mscott) → superreview?(bienvenu)
Attachment #167978 - Flags: superreview?(bienvenu) → superreview+
*** Bug 202231 has been marked as a duplicate of this bug. ***
Patch against trunk, also now appending char rather than string.
nsSmtpServer.cpp uses prefbranch these days.
Attachment #167978 - Attachment is obsolete: true
Comment on attachment 174497 [details] [diff] [review]
patch against trunk

Although I can't wait for the other classes to switch to pref branches too...
Attachment #174497 - Flags: superreview+
Flags: blocking1.8b2?
checkin:
http://tinderbox.mozilla.org/bonsai/cvsquery.cgi?date=explicit&mindate=1108725420&maxdate=1108725840
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Flags: blocking1.8b2?
Resolution: --- → FIXED
*** Bug 330211 has been marked as a duplicate of this bug. ***
*** Bug 335067 has been marked as a duplicate of this bug. ***
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: