Closed Bug 1574590 Opened 7 years ago Closed 7 years ago

Selected LDAP directory server preference becomes de-selected

Categories

(MailNews Core :: LDAP Integration, defect, P2)

defect

Tracking

(thunderbird_esr6868+ fixed, thunderbird69 fixed, thunderbird70 fixed)

RESOLVED FIXED
Thunderbird 70.0
Tracking Status
thunderbird_esr68 68+ fixed
thunderbird69 --- fixed
thunderbird70 --- fixed

People

(Reporter: MabryTyson, Assigned: aleca)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

In TB 60.8.0, 68.0, or 69.0
go to Preferences > Composition > Addressing.
If you don't already have a directory server, create one and make sure it is selected (both checked & selected) (It probably can be a fake one as this doesn't require actual LDAP service)
Now click on Edit Directories. This brings up a window to edit properties. Make sure the window isn't blocking your view of the Preferences window that shows the selected directory server.
With or without making any changes, click OK in the edit properties pop-up.

Actual results:

When I click OK, the selected directory server is deselected and no directory server is selected.

Expected results:

The selected directory server shouldn't get deselected. If it must be (for reasons I don't understand), then please alert the user he should reselect it. Otherwise the user will likely not notice this happened and will get confused when his LDAP directory isn't working.

I'm going to call this a defect but it is a minor one. It is an annoyance and not what I expect you want.

Confirmed. Should be easy to fix. Aceman, can you take a look.

Status: UNCONFIRMED → NEW
Component: Untriaged → LDAP Integration
Ever confirmed: true
Flags: needinfo?(acelists)
Product: Thunderbird → MailNews Core
Version: 69 → 60

Actually, I can't see the menulist being lost in TB 60.

A bit of research: The pref shown in the field is this:
https://searchfox.org/comm-central/search?q=ldap_2.autoComplete.directoryServer&case=false&regexp=false&path=

"Edit directories" runs gComposePane.editDirectories(). Code here:
https://searchfox.org/comm-central/source/mailnews/addrbook/prefs/content

I think this is a de-XBL issue in
https://searchfox.org/comm-central/source/mail/components/addrbook/content/menulist-addrbooks.js

I'll blame it on the original author ;-)

Flags: needinfo?(alessandro)
Version: 60 → 68

Certainly not happening in TB 60. There, if you edit a server name and that server is selected, the display changes accordingly instead of being deselected.

EDIT: And BTW, deselected/empty is not a valid value. If anything, it should be None. So I'm wondering whether it's just a display glitch.

Flags: needinfo?(acelists)

Confirmed, it happens on 68 and 69.
Most likely my fault, I'll deal with it.

Flags: needinfo?(alessandro)
Assignee: nobody → alessandro
Priority: -- → P2
See Also: → 1574712
Keywords: regression

This should fix also bug 1574712.

So, during the de-xbl bug, I overlooked the fact that the menulist value would change and not return anymore "URI" or "dirPrefId", which are the 2 directory types we need in order to properly build the list with names and correct values.

Take a look at what I did and if it makes sense as a solution.

Attachment #9086485 - Flags: review?(mkmelin+mozilla)
Attachment #9086485 - Flags: review?(jorgk)
Comment on attachment 9086485 [details] [diff] [review] 1574590-ldap-directory-regression.patch Review of attachment 9086485 [details] [diff] [review]: ----------------------------------------------------------------- Works for me and looks reasonable. I've kept out of de-XBL and since we're down to two bindings, I was quite successful at that, so I'm not getting involved now ;-) - I hope Magnus can give his seal of approval soon, so we can forget this issue. ::: mail/components/addrbook/content/menulist-addrbooks.js @@ +87,5 @@ > }, { once: true }); > } > > + get _value() { > + return this.getAttribute("value") || "URI"; Why the || "URI"?
Attachment #9086485 - Flags: review?(jorgk) → feedback+

(In reply to Jorg K (GMT+2) from comment #6)

get _value() {
  return this.getAttribute("value") || "URI";

Why the || "URI"?

Argh, that's a leftover.
Maybe at this point the entire getter method can be removed.
I'll fix it.

Perfect green try, even bct passed.

Attachment #9086485 - Attachment is obsolete: true
Attachment #9086485 - Flags: review?(mkmelin+mozilla)
Attachment #9086531 - Flags: review?(mkmelin+mozilla)
Attachment #9086531 - Flags: feedback+
Comment on attachment 9086531 [details] [diff] [review] 1574590-ldap-directory-regression.patch Review of attachment 9086531 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/components/addrbook/content/menulist-addrbooks.js @@ +87,5 @@ > }, { once: true }); > } > > + get _type() { > + return this.getAttribute("type") || "URI"; We talked about this on IRC. So URI is for local lists which don't have that attribute, to distinguish it from LDAP. Maybe add a comment, or use a different string? Or give them a type? I guess there's code that compares with "URI" somewhere outside this patch, so this is minimal change?
Comment on attachment 9086531 [details] [diff] [review] 1574590-ldap-directory-regression.patch Review of attachment 9086531 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/components/addrbook/content/menulist-addrbooks.js @@ +152,5 @@ > // Skip the empty members added above. > continue; > } > > + let listItem = this.appendItem(ab.dirName, ab[type]); While the type approach is better than it was before (which was very confusing), I think we can just make it even more explicit by remoteonly ? ab.dirPrefId : ab.URI There is already remoteonly="true" which seems to be used for the same thing, so it would be preferable to make it conditional on that. This widget has too many options already. Maybe you can add documentation for the attributes one can set? CE:s should also really react to changes of any such attributes but we don't do that atm.
Attachment #9086531 - Flags: review?(mkmelin+mozilla)
Blocks: 1574248

Patch updated to use the remoteonly attribute instead of adding a new one.

I decided to leave the _type() getter as it makes things easier, and added a comment there.
I didn't use the built-in match() method because that's strictly used to add/remove items from the list based on the remoteonly attribute.

This is a bit messed up because address lists are not used consistently across the platform. Example:

In the Address Book or Messenger Compose window
The full list is showed with always the local "URI" value, even for LDAP directories

  • moz-abmdbdirectory://abook.mab
  • moz-abldapdirectory://ldap_2.servers.Adams
  • etc...

In the Preferences > Composition
Only the LDAP directories are showed, using the "dirPrefId" value

  • ldap_2.servers.Test
  • ldap_2.servers.Adams
  • etc...

So, even if the Address Book Object itself has an attribute called isRemote, that doesn't mean we can use it to always return the "dirPrefId" value, because sometimes we need the "URI" even if it's a remote LDAP directory.

I hope what I wrote makes sense.

Attachment #9086531 - Attachment is obsolete: true
Attachment #9086729 - Flags: review?(mkmelin+mozilla)
Status: NEW → ASSIGNED
Comment on attachment 9086729 [details] [diff] [review] 1574590-ldap-directory-regression.patch Review of attachment 9086729 [details] [diff] [review]: ----------------------------------------------------------------- I suppose this works though I still think the _type() getter is superflous
Attachment #9086729 - Flags: review?(mkmelin+mozilla) → review+

20:25:02 - jorgk: aleca: Another tweak to the LDAP thing?
20:26:28 - aleca: jorgk, we can think about that in a follow up bug

Keywords: checkin-needed
Target Milestone: --- → Thunderbird 70.0
Attachment #9086729 - Flags: approval-comm-esr68+
Attachment #9086729 - Flags: approval-comm-beta+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/eb47af85ed8e
Change MozMenulistAddrbooks CE to fix LDAP auto-complete and LDAP server pref. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: