Closed
Bug 107558
Opened 23 years ago
Closed 23 years ago
Unable to add LDAP directory
Categories
(MailNews Core :: LDAP Integration, defect, P1)
Tracking
(Not tracked)
VERIFIED
WORKSFORME
mozilla0.9.8
People
(Reporter: erich, Assigned: srilatha)
References
Details
(Keywords: regression)
Attachments
(2 files, 4 obsolete files)
5.03 KB,
patch
|
Details | Diff | Splinter Review | |
4.89 KB,
patch
|
dmosedale
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
Steps: Edit/Preferences Mail & Newsgroups/Addressing click "Edit Directories.." click Add type in the information for an LDAP server and click OK (your new server shows up in the list) click OK (the new server doesn't make it back to the main Addressing window) click Edit Directories again (the new server is gone) Also, I just imported this profile from NS4.77, and it did not bring over the LDAP information from that, while it has in the past. build 2001103003, win32-installer, windows 2000
Assignee | ||
Comment 1•23 years ago
|
||
Taking this. This is a regression caused by the checkin for bug # 106159
Assignee | ||
Comment 2•23 years ago
|
||
Assignee | ||
Comment 3•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #56002 -
Attachment is obsolete: true
Assignee | ||
Comment 4•23 years ago
|
||
In the new patch, I have createChildList as a method in the interface nsILdapPrefsService. and in pref-directory.js I'm calling createChildList on nsILdapPrefsService.
Comment 5•23 years ago
|
||
in nsLDAPPrefsService.prototype.createChildList (last 4 lines) aCount.value = count; if (!count) return null; return childList; You assign aCount.value to count ... but then if no count return null - Put the return before you do the assignment to aCount.value (this will avoid js errors)
Comment 6•23 years ago
|
||
You probably don't want to call a local variable gPrefInt either :)
Assignee | ||
Comment 7•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #56161 -
Attachment is obsolete: true
Comment 8•23 years ago
|
||
r=chipc@netscape.com looks good to me
Comment 9•23 years ago
|
||
I think I see some issues with this patch; hope you don't mind me chiming in with some review comments. In particular... a) since |createChildList| is only ever called with "ldap_2.servers" as the |prefRoot|, is there any reason not to define this as a local |const| var in the .js file rather than making it a param? If you do this, |parent| looks like it could be const as well. b) when implementing XPCOM interfaces in JS, the way to indicate errors to the caller is to throw an nsresult rather than returning null. throw Components.results.NS_ERROR_FAILURE; c) the regexp |re| currently in use doesn't look quite right: [.] will match any character, not just a dot. But regexps are more heavyweight than necessary for this job anyway; instead of string = directoriesList[i].substr(parent.length, directoriesList[i].length); strLen = string.search(re); you might want to consider using strLen = directoriesList[i].indexOf(".", parent.length); d) can you add @arg, @return, and @exception doxygen comments documenting the possible arguments, the return code, and the possible exceptions that can be thrown by the implementor?
Comment 10•23 years ago
|
||
Comment on attachment 56243 [details] [diff] [review] patch v3 documentation, documentation documentation! What is createChildList doing? we need better variable names than "string" - what does "string" represent? I guess I'm just confused because I can't tell exactly what the point of createChildList is.. how does it differ from getChildList()? Also, why create a seperate array and return that? Why not just muck with the original "directoriesList" and remove the entries that don't match your regular expression? Also, the varable "regexp" is just "", but it sure doesn't look like a regular expression to me.. it looks like some kind of match string. Maybe all these questions would be cleared up if I had an explanation of what this function is doing.
Assignee | ||
Comment 11•23 years ago
|
||
Setting milestone to mozilla 0.9.6.
Severity: normal → major
Priority: -- → P1
Target Milestone: --- → mozilla0.9.6
Assignee | ||
Comment 12•23 years ago
|
||
Comment 13•23 years ago
|
||
Comment on attachment 56634 [details] [diff] [review] patch v4 does this patch even work? This line: + strLen = directoriesList[i].indexOf(".", parent.length); will always return a value of 5, because parent (which is ALWAYS "ldap_2.servers.") has a "." in the 5th position in the string... which means that the following if() statement will ALWAYS be true, and you'll always be truncating directoriesList[i] down to the "servers." portion of the string.. What I think dmose was saying with the whole const isssue, is that if createChildList will always pass in "ldap_2.servers", why not just change the api to: void getServerList(out unsigned long aCount, [array, size_is(aCount), retval] out string aChildArray); and then internally always use "ldap_2.servers."
Attachment #56634 -
Flags: needs-work+
Comment 14•23 years ago
|
||
alecf: actually, it won't always return 5; the second parameter to indexOf means "start searching at this index", so this should actually work ok. you are right as to my original intent on the const stuff, but it looks like srilatha's new patch may do better than that (I don't know the code well enough to be sure) since it takes an existing nsIPrefBranch rather than creating a whole new one.
Assignee | ||
Comment 15•23 years ago
|
||
In the new patch, in createChildList I just assume ldap_2.servers. Actually in patch v3 you could pass any root and get the child List. dmose is right, about indexOf. Alec: the answer to your question, how does createChildList differ from getChildList. The array that is created by getChildList looks like this: ldap_2.servers.Netscape.description ldap_2.servers.Netscape.filename ldap_2.servers.Netscape.replication ldap_2.servers.Netscape.uri ldap_2.servers.test.description ldap_2.servers.test.filename ldap_2.servers.test.replication ldap_2.servers.test.uri The arrray that is created by createChildList looks like this: ldap_2.servers.Netscape ldap_2.servers.test
Blocks: 104864
Assignee | ||
Comment 16•23 years ago
|
||
Assignee | ||
Comment 17•23 years ago
|
||
chip, alec please review the last patch.
Assignee | ||
Updated•23 years ago
|
Attachment #56243 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #56634 -
Attachment is obsolete: true
Assignee | ||
Comment 18•23 years ago
|
||
In the last patch I changed the api name to getServerList. Also I am using only one array directoriesList.
Assignee | ||
Comment 19•23 years ago
|
||
Assignee | ||
Comment 20•23 years ago
|
||
After talking to Alec over aim, we decided to go with the two array solution since it is much cleaner.
Comment 21•23 years ago
|
||
Comment on attachment 56775 [details] [diff] [review] the two array solution sr=alecf, with a few extra lines of comments that srilatha and I discussed Also, I would like r=dmose on this
Attachment #56775 -
Flags: superreview+
Comment 22•23 years ago
|
||
Comment on attachment 56775 [details] [diff] [review] the two array solution OK, two minor nits: In the doxygen comments: @aChildArray Receives the array with "ldap_2.servers.<server-name>". Shouldn't that really be @param aChildArray stuff... Also + try { + directoriesList = prefBranch.getChildList(prefRoot, prefCount); + } + catch (ex) { + directoriesList = null; + } Instead of setting directoriesList to null here and executing a bunch more code, either throw a new NS_ERROR_FAILURE, or else remove the try/catch wrapper completely and allow the exception from nsIPref to propagate up the stack. Fix those, and you've got r=dmose.
Attachment #56775 -
Flags: review+
Assignee | ||
Comment 23•23 years ago
|
||
Fix checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 24•23 years ago
|
||
I'm seeing this again 20001112603, Windows XP Pro
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 25•23 years ago
|
||
WFM Mac OSX 2001112705 build.
Comment 26•23 years ago
|
||
Moving to 0.9.8. This worksforme on the 11/26 build on Win 2000. yulian, are you able to reproduce this?
Target Milestone: mozilla0.9.6 → mozilla0.9.8
Comment 27•23 years ago
|
||
sorry, changed my mind. If we can reproduce we should fix it soon.
Target Milestone: mozilla0.9.8 → mozilla0.9.7
Updated•23 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Comment 28•23 years ago
|
||
Works for me with 2002010703 Wins build on NT.
Assignee | ||
Comment 29•23 years ago
|
||
Worksforme on windows XPPro with 2002010703. Please reopen this bug if you are still seeing the problem
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → WORKSFORME
Updated•20 years ago
|
Product: MailNews → Core
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•