Closed
Bug 1482040
Opened 6 years ago
Closed 6 years ago
Add UID property to address book interfaces
Categories
(MailNews Core :: Address Book, enhancement)
MailNews Core
Address Book
Tracking
(thunderbird_esr6064+ fixed, thunderbird64 fixed)
RESOLVED
FIXED
Thunderbird 64.0
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(3 files, 6 obsolete files)
21.55 KB,
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
21.56 KB,
patch
|
jorgk-bmo
:
approval-comm-esr60+
|
Details | Diff | Splinter Review |
1.56 KB,
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
This is the same patch I posted in bug 1469238. It really should be in its own bug, so here we are.
Updated•6 years ago
|
Version: unspecified → Trunk
Assignee | ||
Comment 1•6 years ago
|
||
Updated patch to go with the other bug. It's the same as the first, but without the letter G.
Attachment #8998739 -
Attachment is obsolete: true
Attachment #9005103 -
Flags: review?(mkmelin+mozilla)
Comment 2•6 years ago
|
||
Comment on attachment 9005103 [details] [diff] [review] 1482040-addressbook-guids-2.diff Review of attachment 9005103 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/addrbook/public/nsIAbCard.idl @@ +108,5 @@ > * implementations SHOULD NOT, in general, modify this property. > */ > attribute AUTF8String localId; > > + attribute ACString UID; probably better make it AUTF8String (like localId) above. And please add documentation too.
Attachment #9005103 -
Flags: review?(mkmelin+mozilla) → review+
Assignee | ||
Updated•6 years ago
|
Summary: Add GUID property to address book interfaces → Add UID property to address book interfaces
Assignee | ||
Comment 3•6 years ago
|
||
I've not changed it to AUTF8String because there is no situation where it will need non-ASCII characters. I've documented what the contents of the property should be and stated that others should not change the value once set.
Attachment #9005103 -
Attachment is obsolete: true
Attachment #9005159 -
Flags: review+
Comment 4•6 years ago
|
||
Yes we're not perhaps expecting non-ASCII. But I think anything new should use UTF-8 for everything, so there's one thing less to worry about.
Comment 5•6 years ago
|
||
Comment on attachment 9005159 [details] [diff] [review] 1482040-addressbook-guids-3.diff Review of attachment 9005159 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/addrbook/public/nsIAbCard.idl @@ +110,5 @@ > attribute AUTF8String localId; > > /** > + * A unique identifier for this card. > + * It should be 9 random bytes, base 64 encoded: 12 ASCII characters. I'll comment on the other bug @@ +111,5 @@ > > /** > + * A unique identifier for this card. > + * It should be 9 random bytes, base 64 encoded: 12 ASCII characters. > + * This attribute is set by the WebExtensions interface and Hmm, we might want to use it internally too? At least in the future
Assignee | ||
Comment 6•6 years ago
|
||
UIDs are now set on read if empty, and cannot be set by script.
Attachment #9005159 -
Attachment is obsolete: true
Attachment #9008360 -
Flags: review?(mkmelin+mozilla)
Comment 7•6 years ago
|
||
Comment on attachment 9008360 [details] [diff] [review] 1482040-addressbook-guids-4.diff Review of attachment 9008360 [details] [diff] [review]: ----------------------------------------------------------------- Great, r=mkmelin
Attachment #9008360 -
Flags: review?(mkmelin+mozilla) → review+
Assignee | ||
Comment 8•6 years ago
|
||
Changed to keep the UID in memory as well as in the prefs for address books, so we still have it when making a delete notification. Also some style changes I learned about shortly after submitting last time.
Attachment #9008360 -
Attachment is obsolete: true
Attachment #9008981 -
Flags: review+
Comment 9•6 years ago
|
||
Comment on attachment 9008981 [details] [diff] [review] 1482040-addressbook-guids-5.diff Review of attachment 9008981 [details] [diff] [review]: ----------------------------------------------------------------- Great that you fixed that! ::: mailnews/addrbook/src/nsAbDirProperty.cpp @@ +154,5 @@ > +NS_IMETHODIMP nsAbDirProperty::GetUID(nsACString &aUID) > +{ > + nsresult rv = NS_OK; > + aUID = mUID; > + if (aUID.IsEmpty() && !m_IsMailList) { nit: while the same thing, it's more logical to test mUID.IsEmpty() and then go on to assign as nesseary But I actually had a question too. Why are mailLists treated differently here and in nsAbDirProperty::SetUID? The test you added says they do have an uid.
Assignee | ||
Comment 10•6 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #9) > nit: while the same thing, it's more logical to test mUID.IsEmpty() and then > go on to assign as nesseary You mean like I've done it here? > But I actually had a question too. Why are mailLists treated differently > here and in nsAbDirProperty::SetUID? The test you added says they do have an > uid. Address books store their UID in the prefs (ldap_2.servers.foo.uid) but mailing lists are stored in the mork database as an nsIAbCard. But mailing lists also implement nsIAbDirectory so the UID is copied from the card object to the directory object and we only keep it in memory.
Attachment #9008981 -
Attachment is obsolete: true
Attachment #9011989 -
Flags: review+
Comment 11•6 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #10) > You mean like I've done it here? Yes, thx!
Comment 12•6 years ago
|
||
Pushed by geoff@darktrojan.net: https://hg.mozilla.org/comm-central/rev/2bab51e3b5c2 Add UID property to address book interfaces; r=mkmelin
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Target Milestone: --- → Thunderbird 64.0
Comment 13•6 years ago
|
||
Ben requested backport of bug 1490626 which depends on this bug. I needed to verify that the backport will indeed allow us to import the API from bug 1469238 as an Experiment API and use that in Thunderbird 60 after the backport. To save you from having to fix the not quite trivial whitespace changes twice, this is the diff I ended up using for ESR 60.
Attachment #9021487 -
Flags: approval-comm-esr60?
Comment 14•6 years ago
|
||
Well, for the white-space changes I would have just uplifted https://hg.mozilla.org/releases/comm-beta/rev/7ebd318d99dac3805458096431ef1f5bf8aa6633 https://hg.mozilla.org/releases/comm-beta/rev/505528fac6296ffb436caf0b8c711df8d8c5f621 See bug 1463266 comment #31. Then the patch almost applies with two minor tweaks.
Comment 15•6 years ago
|
||
Comment on attachment 9021487 [details] [diff] [review] Whitespace changes for ESR 60 uplift Sorry, I've fixed the white-space issues in ESR 60 now. Can you rebase this again, this time it will be a three-minute job. Next time, please ask.
Attachment #9021487 -
Attachment is obsolete: true
Attachment #9021487 -
Flags: approval-comm-esr60?
Comment 16•6 years ago
|
||
(In reply to Jorg K from comment #15) > Sorry, I've fixed the white-space issues in ESR 60 now. Can you rebase this > again, this time it will be a three-minute job. Next time, please ask. I double-checked and the original patch now applies to nsAddrDatabase.cpp correctly but you didn't backport the white-space changes to nsAbDirProperty.* so there's still one white space conflict in each file.
Comment 17•6 years ago
|
||
You mean https://hg.mozilla.org/comm-central/rev/7692c0e19b39. I didn't intend to backport that, so your patch is welcome.
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
Comment on attachment 9021588 [details] [diff] [review] Fewer whitespace changes for ESR 60 uplift [Approval Request Comment] User impact if declined: Owl needs to support 2 different address book APIs, one for TB 60 and one for TB trunk. Testing completed (on c-c, etc.): Owl on TB 60 with this patch works. Risk to taking this patch (and alternatives if risky): Most of the patch adds new functions, so that should be safe. nsAddrDatabase.cpp adds a few calls in existing code.
Attachment #9021588 -
Flags: approval-comm-esr60?
Comment 20•6 years ago
|
||
Comment on attachment 9021588 [details] [diff] [review] Fewer whitespace changes for ESR 60 uplift Good for 60.4.
Attachment #9021588 -
Flags: approval-comm-esr60? → approval-comm-esr60+
Comment 21•6 years ago
|
||
TB 60.4 ESR: https://hg.mozilla.org/releases/comm-esr60/rev/7fe1827e6b395377f9c72160e9d191104fc313ed
status-thunderbird64:
--- → fixed
status-thunderbird_esr60:
--- → fixed
tracking-thunderbird_esr60:
--- → 64+
Comment 22•6 years ago
|
||
As you can see, I've uplifted this now, but a test is not working: TEST-UNEXPECTED-FAIL | comm/mailnews/addrbook/test/unit/test_uid.js | xpcshell return code: 0 TypeError: MailServices.ab.directories is not iterable at /builds/worker/workspace/build/tests/xpcshell/tests/comm/mailnews/addrbook/test/unit/test_uid.js:19 Line 19 is: for (let book of MailServices.ab.directories) { Can someone please provide a fix for this.
Flags: needinfo?(neil)
Flags: needinfo?(ggladden)
Updated•6 years ago
|
Flags: needinfo?(ggladden) → needinfo?(geoff)
Comment 23•6 years ago
|
||
Neil will look into it.
Comment 25•6 years ago
|
||
Comment on attachment 9026410 [details] [diff] [review] Fix test failure on ESR60 Thanks for looking into it, Neil. I'll get Geoff to review it and I'll get it landed after that. Layman's question: Would this work: for (let book of fixIterator(MailServices.ab.directories, Ci.nsIAbDirectory) { I'm not sure how that could be applied to the second call site, perhaps let bookCards = [...fixIterator(book.childCards,Ci.nsIAbCard)]; Either way, it's just a small test fix.
Flags: needinfo?(geoff)
Attachment #9026410 -
Flags: review?(geoff)
Assignee | ||
Comment 26•6 years ago
|
||
Comment on attachment 9026410 [details] [diff] [review] Fix test failure on ESR60 Review of attachment 9026410 [details] [diff] [review]: ----------------------------------------------------------------- I'm happy with this. The fixIterator way should work too, but as this is a test on ESR, I'm really not bothered which you use.
Attachment #9026410 -
Flags: review?(geoff) → review+
Comment 27•6 years ago
|
||
I didn't know whether fixIterator was in scope, as the other tests didn't seem to use it.
Comment 28•6 years ago
|
||
Yes, little usage in tests, but there's one here importing it: https://searchfox.org/comm-central/rev/bcbcd1dcf23821605e10f1cf1b00bf3d14460a73/mailnews/imap/test/unit/test_localToImapFilter.js#14
Comment 29•6 years ago
|
||
https://hg.mozilla.org/releases/comm-esr60/rev/a6e340fe4c07d16d962abab48404aad0d07848b8 Fix failure in test_uid.js by iterating MailServices.ab.directories 'manually'. r=darktrojan
Comment 30•6 years ago
|
||
Thanks, everybody
Updated•6 years ago
|
Attachment #9026410 -
Attachment description: Test fix → Fix test failure on ESR60
Comment 31•6 years ago
|
||
Backed out from the ESR: https://hg.mozilla.org/releases/comm-esr60/rev/e4d520b5dc17e8a0e3ba4d760556b1ba4aad4842 Backed out changeset a6e340fe4c07 and 7fe1827e6b39 (bug 1482040) for causing address book and auto-complete slowness (bug 1511885). a=backout
status-thunderbird_esr60:
fixed → ---
tracking-thunderbird_esr60:
64+ → ---
Comment 32•5 years ago
|
||
Relanded for TB 60.4.0 ESR: https://hg.mozilla.org/releases/comm-esr60/rev/a02f10ecb5fdcb78ebe00b432c3c808e86de39c4 https://hg.mozilla.org/releases/comm-esr60/rev/707388b59cb577cad0242f36bfa15d902ff65408
status-thunderbird_esr60:
--- → fixed
tracking-thunderbird_esr60:
--- → 64+
Comment 33•5 years ago
|
||
Hi Geoff,
I tried to use the new UID but with mailing lists I run into an issue: the UID is not persistent and changes between requests. I am still working with old address book interface and not the new mailextension you are working with. Are you seeing the same thing?
I have a standard address book listener and in onItemPropertyChanged I just log the UID to the console, if Item.isMailList.
This may be related to a general (stupid) bug in Mailing lists cards, that they do not keep any property assigned to them except NickName. Can anyone confirm this?
I am on TB 60.4
Comment 34•5 years ago
|
||
Hi John, please file a new bug about that, and cc Geoff. (You can use "Clone This Bug" below)
Comment 35•5 years ago
|
||
Crash on Mac: bug 1523904
You need to log in
before you can comment on or make changes to this bug.
Description
•