Closed Bug 1676128 Opened 2 months ago Closed 2 months ago

UpdateExtraAddressProcessing function randomly throws exception "JavaScript component does not have a method named: "hasEmailAddress""

Categories

(Thunderbird :: Address Book, defect)

defect

Tracking

(thunderbird_esr78 fixed, thunderbird84 fixed)

RESOLVED FIXED
85 Branch
Tracking Status
thunderbird_esr78 --- fixed
thunderbird84 --- fixed

People

(Reporter: cmgaudry33, Assigned: cmgaudry33)

Details

Attachments

(2 files, 4 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36

Steps to reproduce:

  • Select a message in a folder
  • Add multiple mailing lists from the Address books window
  • Display the console

Actual results:

Some time the following exception is thrown :

[Exception... "JavaScript component does not have a method named: "hasEmailAddress"'JavaScript component does not have a method named: "hasEmailAddress"' when calling method: [nsIAbCard::hasEmailAddress]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: chrome://messenger/content/msgHdrView.js :: UpdateExtraAddressProcessing :: line 1546" data: no] msgHdrView.js:1546:17
UpdateExtraAddressProcessing chrome://messenger/content/msgHdrView.js:1543
updateExtraAddressProcessing chrome://messenger/content/mailWidgets.js:1225
OnAddressBookDataChanged chrome://messenger/content/msgHdrView.js:407
forEach self-hosted:225
OnAddressBookDataChanged chrome://messenger/content/msgHdrView.js:401
onItemAdded chrome://messenger/content/msgHdrView.js:380
notifyDirectoryItemAdded resource:///modules/AddrBookManager.jsm:521
addMailList resource:///modules/AddrBookDirectory.jsm:1105
...

Expected results:

No exception because :

  • AddrBookMailling.asCard method should return a card implementing the hasEmailAddress method defined in the nsIAbCard interface.
  • UpdateExtraAddressProcessing method should check if item is a mailing list or not before calling the hasEmailAddress, to be efficient.

This patch add hasEmailAddress method implementation for mailinglist as card object.

Attached patch bug_1676128_msgHdrView.diff (obsolete) — Splinter Review

This patch adds check on the item type before calling its method hasEmailAddress because no need to call this method if the item is a mailing list.

Attachment #9186622 - Attachment is obsolete: true
Attached patch bug_1676128_msgHdrView.diff (obsolete) — Splinter Review
Attachment #9186625 - Attachment is obsolete: true
Attachment #9186627 - Attachment is obsolete: true
Attachment #9186628 - Attachment is obsolete: true
Component: Untriaged → Address Book

Chris, please remember to flag patches for review.

Assignee: nobody → chris.m.gaudry
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9186633 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9186633 [details] [diff] [review]
bug_1676128_msgHdrView.diff

Review of attachment 9186633 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks. r=mkmelin
Attachment #9186633 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → 85 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/a6a68fcf215a
Make UpdateExtraAddressProcessing function not throw Error of "does not have a method named: "hasEmailAddress" when mail lists are updated r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED

Comment on attachment 9186633 [details] [diff] [review]
bug_1676128_msgHdrView.diff

[Approval Request Comment]
Cleaning up errors, quite safe to uplift

Attachment #9186633 - Flags: approval-comm-esr78?
Attachment #9186633 - Flags: approval-comm-beta?

Comment on attachment 9186633 [details] [diff] [review]
bug_1676128_msgHdrView.diff

[Triage Comment]
Approved for beta

Attachment #9186633 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9186633 [details] [diff] [review]
bug_1676128_msgHdrView.diff

[Triage Comment]
Approved for esr78

Attachment #9186633 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.