Unbind not working with node 10
See original GitHub issueWhen I try to use ldapjs client.unbind
with node 10.0.0 (or 10.4.0) it does not work and the callback of unbind is never called. I debugged and it seems something in _sendSocket
stops working, the function messageCallback
is never called. While debugging it worked sometimes and the UnbindResponse
was received successfully, but most of the time it didn’t work, so I was wondering if it might be some timing issue, as while debugging everything runs slower/stepped.
The last trace log I see is:
{"name":"ldapjs","component":"client","hostname":"abc","pid":60921,"clazz":"Client","ldap_id":"6__ldaps://ldap.domain.net","level":10,"msg":"sending request {\"messageID\":3,\"protocolOp\":\"UnbindRequest\",\"controls\":[]}","time":"2018-06-07T10:39:44.165Z","v":0}
The code is
client.search(
'ou=domain,dc=sub,dc=net',
opts, (err, res) => {
if (err) {
cb(err, null);
return;
}
res.on(
'searchEntry', entry => {
if (entry.object.hasOwnProperty('mail')) {
retrievedUsers[entry.object.uid] = entry.object;
}
}
);
res.on(
'error', err => {
cb(err, null);
client.unbind(
err => {
if (err) {
logger.error(err);
}
}
);
}
);
res.on(
'end', () => {
client.unbind(
err => { // << --- never called
cb(err, retrievedUsers);
}
);
}
);
}
);
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Unbinding events in Node.js - Stack Overflow
My question is, is there any way to remove/replace a callback once bound? Or is the only approach to bind a proxy callback...
Read more >jQuery bind/unbind not working on firefox or in some other ...
So, your jQuery bind is working OK on all browsers and not in firefox? At least in my case, it worked on chrome...
Read more >How to unbind “hover” event using JQuery? - GeeksforGeeks
Approach: Select the element whose Hover effect needs to be unbinded.(Make sure Hover effect should be added by JQuery only, Hover effect added ......
Read more >Unbind Request Received starting IP-DLC conection Event ID ...
I have My HOSTSYS connection change from ACTIVE to PENDING in a loop. IP-DLC connection was working until MS11-082 was installed.
Read more >ldapjs Client API
If a logger is supplied that does not have such a method, then a shim version is ... Node.js will print a stack...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@purplemana It’s fixed with https://www.npmjs.com/package/ldapts, if you want to give that a go.
@jgeurts I just switched to using
ldapts
package instead. Ended up producing better code and easier to test and works with node 11.