cozy / cozy-emails

Email Client for Cozy
GNU Affero General Public License v3.0
66 stars 41 forks source link

TypeError: Cannot read property 'shouldNotif' of undefined #682

Closed clochix closed 8 years ago

clochix commented 8 years ago

A user reports that after an update, the application doesn't start. Here's an error found in the logs;

/usr/local/cozy/apps/emails/build/server/processes/mailbox_refresh_fast.js:125
_this.shouldNotif || (_this.shouldNotif = info.shouldNotif);
^
TypeError: Cannot read property 'shouldNotif' of undefined
  at /usr/local/cozy/apps/emails/build/server/processes/mailbox_refresh_fast.js:125:59
  at Object.callback (/usr/local/cozy/apps/emails/build/server/models/message.js:373:16)
  at ImapPool.module.exports.ImapPool._onActiveClose (/usr/local/cozy/apps/emails/build/server/imap/pool.js:166:14)
  at ImapConnection.g (events.js:180:16)
  at ImapConnection.EventEmitter.emit (events.js:95:17)
  at Socket.<anonymous> (/usr/local/cozy/apps/emails/node_modules/imap/lib/Connection.js:155:10)
  at Socket.g (events.js:180:16)
  at Socket.EventEmitter.emit (events.js:117:20)
at TCP.close (net.js:465:12)
clochix commented 8 years ago

In https://github.com/cozy/cozy-emails/blob/master/server/processes/mailbox_refresh_fast.coffee#L116 we don't handle the case where there's an error and info is null.

clochix commented 8 years ago

Here are the logs just before the crash:

EROR +0691 imap:pool error on active imap socket on imap.gmail.com:993 { [Error: read ECONNRESET]
  code: 'ECONNRESET',
    errno: 'ECONNRESET',
    syscall: 'read',
    source: 'socket' }
    DBUG +0009 imap:pool 4e3eded7f9e22b75fe416030221f75ef remove conn1 from pool
    EROR +0005 imap:pool active connection imap.gmail.com:993 closed true
poupotte commented 8 years ago

This issue is fixed in new version (0.9.18). Thnaks @aenario :)