Open
Bug 531348
Opened 16 years ago
Updated 1 year ago
After adding then deleting card in Mailing List, re-adding (via addon js code) fails until restart of TB
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(Not tracked)
NEW
People
(Reporter: rkent, Unassigned)
References
Details
I encountered this while testing a feature to my extension FiltaQuilla, where I am adding addresses to a mailing list as a custom filter action.
The js code to add a card to a mailing list looks like this:
let card = Cc["@mozilla.org/addressbook/cardproperty;1"]
.createInstance(Ci.nsIAbCard);
card.primaryEmail = addresses[0];
card.displayName = names[0];
dir.addCard(card);
Given that, here are my STR:
1) add a new email to a mailing list using the code above
2) In the address book UI, selected and delete the card
3) Re-add the card (either with the code above, or manually by dragging into the mailing list in the address book UI)
Expected result: card is added
Actual result: card is not added.
Workaround: after restart, the add starts to work again.
Tracing through the C++, the second add fails because in
nsAddrDatabase::CreateNewListCardAndAddToDB
the deleted card still exists in "addressList" that is obtained from the call to aList->GetAddressLists(getter_AddRefs(addressList)), so the add silently fails because it thinks the card is already in the list.
I stopped investigating at this point, because this is a second order failure that does not directly affect the viability of my new filter action. But it should be fixed, because there could be other manifestations of the same thing.
Comment 1•13 years ago
|
||
Kent, could this be related to Bug 758969?
Summary: After adding then deleting card to mail list, adds fail until restart → After adding then deleting card in Mailing List, re-adding (via addon js code) fails until restart of TB
Comment 2•7 years ago
|
||
(In reply to Thomas D. (currently busy elsewhere) from comment #1)
> Kent, could this be related to Bug 758969?
Jorg, you've been having fun with Bug 758969 in recent years. Do you agree it is related?
Flags: needinfo?(jorgk)
Comment 3•7 years ago
|
||
I don't quite understand the question. Bug 758969 is a meta-bug, so surely you can let this bug here block it. That said, the STR are simple enough to try again.
Supposedly |aList->GetAddressLists(getter_AddRefs(addressList))| returns a deleted card, so the same card cannot be added. The code is still here:
https://searchfox.org/comm-central/rev/4dc0fffdce2428c5cbceec6953de5b4eeb634907/mailnews/addrbook/src/nsAddrDatabase.cpp#1182
However, we cleaned up some "shadow" card processing in bug 1383617, so perhaps that solved the bug here. I would have to be retested.
Maybe Aceman has an insight.
Blocks: 758969
Flags: needinfo?(jorgk) → needinfo?(acelists)
Sadly this still exists.
Adding the same contact to a ML in the same session fails.
Flags: needinfo?(acelists)
Updated•3 years ago
|
Severity: normal → S3
Comment 5•3 years ago
|
||
(In reply to :aceman from comment #4 - 2018-09-08)
Sadly this still exists.
Adding the same contact to a ML in the same session fails.
John, is this still a problem for add-ons?
Flags: needinfo?(john)
Comment 6•2 years ago
|
||
Just want to acknowledge, that I have seen this. Will look at it - and try to fix it - before 115.
Updated•1 year ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(john)
Version: Trunk → Thunderbird 81
Updated•1 year ago
|
Component: Address Book → Add-Ons: Extensions API
Product: MailNews Core → Thunderbird
You need to log in
before you can comment on or make changes to this bug.
Description
•