Closed Bug 1777214 Opened 3 years ago Closed 3 years ago

Cannot edit contacts with a least 2 e-mail addresses (when PREF=1 missing)

Categories

(Thunderbird :: Address Book, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102+ fixed, thunderbird103 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
thunderbird_esr102 + fixed
thunderbird103 --- fixed

People

(Reporter: ak.bugzilla, Assigned: u695164)

References

(Blocks 1 open bug)

Details

(Whiteboard: [TM:102.0.1optimistic])

Attachments

(1 file)

Steps to reproduce:

I have contacts with at least 2 e-mail addresses which are synced with CardDAV. When I click the "edit" button, nothing happens.
When I edit a contact with one e-mail in Thunderbird and add a second e-mail address, everything works as expected. Adding a second e-mail address in the webmailer and syncing it to Thunderbird makes the edit button stop working.
I can reproduce this behaviour with CardDAV address books hosted by posteo.de and google.com.

Are you using an add-on?

Flags: needinfo?(ak.bugzilla)

No, I use the build-in CardDAV function.
I see the same behaviour in troubleshoot mode with deactivated add-ons.

Flags: needinfo?(ak.bugzilla)

I have the same problem!
Looking the Error-Console, the following errors are logged when trying to edit these contacts

about:addressbook : Unable to run script because scripts are blocked internally. 30

Uncaught TypeError: defaultEmail is undefined
    getDefaultEmail chrome://messenger/content/addressbook/edit/edit.js:313
    updateEmailHeading chrome://messenger/content/addressbook/edit/edit.js:294
    updateView chrome://messenger/content/addressbook/edit/edit.js:172
    set vCardProperties chrome://messenger/content/addressbook/edit/edit.js:110
    editCurrentContact chrome://messenger/content/addressbook/aboutAddressBook.js:2858
    _onClick chrome://messenger/content/addressbook/aboutAddressBook.js:3180
    handleEvent chrome://messenger/content/addressbook/aboutAddressBook.js:2313

Found the possible issue, vCard contacts which have multiple email addresses but are not marked with the "pref=1" key in the vcf, cannot be edited by Thunderbird and the error above is thrown

# OK (has "PREF" KEY )
EMAIL;PREF=1;TYPE=home:user_home@domain.tld
EMAIL;TYPE=work:user_work@domain.tld


# ERROR (PREF=1 missing)
EMAIL;TYPE=other:user_home@domain.tld
EMAIL;TYPE=other:user_work@domain.tld

Thanks for the bug report and investigating the issue!
Can confirm this. The default email handling needs to be more defensive. Address Books from other sources e.g. Google might truncate the pref value.

Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1777329
Assignee: nobody → nicolai
Status: NEW → ASSIGNED
Target Milestone: --- → 104 Branch

This is pretty bad? IF so Let's get it uplifted ASAP.

Pushed by nicolai@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/f08f20b2d72d
Fallback for Address Books with no pref support. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9283631 [details]
Bug 1777214 - Fallback for Address Books with no pref support. r=darktrojan

[Approval Request Comment]
User impact if declined: Contacts who have more than one email and are from a different source besides the vCard based Address Books from Thunderbird are not editable by us.
Testing completed (on c-c, etc.): just landed on c-c, test coverage should follow. Manual tested by me on linux64 with CardDAV from google.
Risk to taking this patch (and alternatives if risky): The patch is not platform dependent. Another pair of eyes for this issue would decrease the risk.

Attachment #9283631 - Flags: approval-comm-esr102?

(In reply to Wayne Mery (:wsmwk) from comment #9)

This is pretty bad? IF so Let's get it uplifted ASAP.

This is pretty bad. Let's get it up!

Comment on attachment 9283631 [details]
Bug 1777214 - Fallback for Address Books with no pref support. r=darktrojan

[Approval Request Comment]
Needs to be on beta before 102.

Attachment #9283631 - Flags: approval-comm-beta?

Comment on attachment 9283631 [details]
Bug 1777214 - Fallback for Address Books with no pref support. r=darktrojan

[Triage Comment]
Approved for beta

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

optimistically approving for TB102.0.1 - assuming it will pass beta over the next several days

Whiteboard: [TM:102.0.1optimistic]

Comment on attachment 9283631 [details]
Bug 1777214 - Fallback for Address Books with no pref support. r=darktrojan

[Triage Comment]

Attachment #9283631 - Flags: approval-comm-esr102? → approval-comm-esr102+
Summary: Cannot edit contacts with a least 2 e-mail addresses → Cannot edit contacts with a least 2 e-mail addresses (when PREF=1 missing)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: