Closed Bug 47932 Opened 24 years ago Closed 24 years ago

Deleted cards in Collected AB doesn't get re-created.

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: skasinathan, Assigned: chuang)

Details

(Whiteboard: [nsbeta3+])

Steps:
1. Read a msg. (say sender is john@netscape.com). The sender is added to 
Collected AB by default. 
2. Launch AB and delete this card (john@netscape.com) from Collected AB.
3. Read another mail from the same person (or send a mail to the same address). 
There is no entry for the address in Collected AB. 

Note:
1. Doesn't matter pop/imap account, migrated/new profile.
2. I think this is the problem behind bug 47135 (which is logged by fenella).

Build and Platform:
Today's branch (M17) builds on all platforms.
QA Contact: lchiang → esther
I think this is no longer related to just Collected AB. This occurs in Personal 
AB (PAB) also. Steps to reproduce in PAB.

1. Assume the AB's doesn't have any entries in it. 
2. Create a new mailing list (list1) in PAB and add two entries to it 
(email1@netscape.com and email2@netscape.com). These two emails are 
automatically added to PAB.  
3. Delete one email (email1@netscape.com) from PAB. => it is also deleted from 
the list1.  (So far so good :))
4. Now create another mailing list (list2) in PAB. Add two entries to it, say 
email1@netscape.com and email3@netscape.com.  email3 is added to PAB. email1 is 
_not_ added to PAB. It should.

reassigning to chuang.
Assignee: putterman → chuang
Keywords: mail4, nsbeta3
Target Milestone: --- → M18
+ per mail triage, P2
Priority: P3 → P2
Whiteboard: [nsbeta3+]
Reassign to bienvenu.  I traced the code, it looks like mork FindRow() still 
find the deleted row (address book use CutRow())in database.  I have tried on 
both in the same session or restart the application.  

The calling function for FindRow() call is in 
nsAddrDatabase::GetRowForCharColumn();
Assignee: chuang → bienvenu
that just means you have a ref-counting problem, I bet (i.e., holding onto an 
extra ref). It works fine for e-mail.
have you tried cutting all columns as well, like the msg db code does?
e.g., 		row->CutAllColumns(GetEnv());

Plus, I'm not sure you've got all your ref-counting right, in the code I looked 
at anyway.
ok, I'll take it back and look for the ref count problem.
Assignee: bienvenu → chuang
The following code, for example, leaks:

				for(PRUint32 i = 0; i < cardCount; i++)
				{
					nsISupports* cardSupports = cardArray->ElementAt(i);
					nsIAbCard* card = (nsIAbCard*)cardSupports;
					if (card)
					{
						database->DeleteCard(card, PR_TRUE);
					}
				}


because cardArray->ElementAt(i) addrefs, but you're never releasing. nsCOMPtrs
would help with problems like these.
Calling CutAllColumns() fixed the problem.  I'll make sure it also fix for 
Personal address book, Mailing list.  Ref count may not be the problem here.
Great! But even if the ref-counting isn't the problem here, it will cause memory
leaks so we should clean that up too.
Fix checked in Yesterday.
Status: NEW → ASSIGNED
marked fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Using build 2000-09-06 on win98, mac and linux this is fixed.  Verified.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.