Update Connection.js - #546
Conversation
add some check on object _curReq and object box before use it
It's fix some uncaugth error like :
self._box.name = name;
^
TypeError: Cannot set property 'name' of undefined
at Connection.<anonymous> (/root/thethingbox/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Connection.js:422:22)
or
var msg = self._curReq.fetchCache[info.seqno], toget;
^
TypeError: Cannot read property 'fetchCache' of undefined
at Parser.<anonymous> (/root/thethingbox/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Connection.js:196:27)
|
I'd be more interested in knowing why there are |
|
I'm not sure what you want I debug, I added just after the when the error come, I obtain this log : ( removing the mail adress and password) |
|
Ok, so the parser still thinks it's parsing the results from a |
|
I set
|
|
Are you reusing client instances or? Can you show how you're using the module? |
|
It's come when I use the node mail of node-red so, each 10 seconds, this code is called : (line 180 of file 61-email.js) |
|
That looks relatively ok. Are you re-using |
|
this node-red module do |
|
Ok looking at the debug output again and with what you just told me, I think it makes sense now. I believe The underlying downstream problem still exists though, even with the aforementioned patch. A connection is being requested, but since the same instance is being reused, it's not waiting for the previous connection to be ready first (and possibly execute any So some possible suggestions for changes to the
|
|
@mscdex This seems to be related to #591. The suggested patch works, but it seemed like the request got stuck in like 1 of 10 attempts at first, thought it easily might have been something else. What do we do? Happy to work on the PR, but would appreciate some guidance – very new to the lib and the IMAP business. 👍 |
|
My particular issue appears my own fault – reconnecting on any status other than |
see PR mscdex#564 in original repo: mscdex#546 These crashes might result from user errors... but still it makes sense to not just crash because of accessing uninitialized variables.
add some check on object _curReq and object box before use it
It's fix some uncaugth error like :
or