mkiol / GNotifier

Thunderbird add-on that replaces built-in notifications with the OS native notifications
https://addons.mozilla.org/thunderbird/addon/gnotifier/
GNU General Public License v3.0
164 stars 25 forks source link

[Thunderbird] Notifications stop working after a while #159

Closed gabrielfin closed 7 years ago

gabrielfin commented 7 years ago

After a while of having Thunderbird open (maybe 3 or 4 hours) new mail notifications stop showing up. I still get the notification sound (from TB) and the blue envelope in the messaging menu (from Ubuntu), but no notification popup. While this is happening, the "Test notification" button does work. Restarting TB solves the issue.

Is anyone else experiencing this problem?

The only error I see in the console is NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMessageService.streamMessage] but I doesn't look like it has anything to do with Gnotifier.

I'm trying to gather more information, but it's complicated since it's hard to reproduce. Gonna try to come back in a couple of days with more details. I'm reporting this in case anyone is experiencing the same problem.

OS: Ubuntu 14.04 TB: 52.0

gabrielfin commented 7 years ago

Ok, I think I found the problem. MsgHdrToMimeMessage (which is called in format) only works for emails which are synchronized. When used with an email of which the body hasn't been downloaded, then it throws the error: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMessageService.streamMessage]. Sounds reasonable, but I expected MsgHdrToMimeMessage to also download the message if needed.

Since notifications are placed in a buffer, if the first one throws an error, all others won't be shown. That's why all notifications stop working.

In order to reproduce the issue:

  1. Add %b in either the title or text of the notification
  2. Go to a folder which is not synchronized (ie. where right click > "Properties" > "Synchronization" > "Select this folder for offline use" is unchecked)
  3. Select any e-mail and click on the "Test notification" button. No notification will show up.

I have already found an alternative way of obtaining the message body. I'll be posting a PR.

mkiol commented 7 years ago

That is an excellent news! I've already got few emails from users affected by this nasty bug. I tried to troubleshoot it but failed. Thank you for your all contribution to this project.

davejm commented 7 years ago

The PR didn't seem to fix the issue for me

mkiol commented 7 years ago

@davejm Windows or Linux? Did you try the latest gnotifier-1.9.9-preX.xpi package?

davejm commented 7 years ago

@mkiol Linux Mint 18.1. I compiled the code on master and installed that

davejm commented 7 years ago

I think I would have ended up with pre7 looking at the commits. I'll pull the most recent commits and try again.

davejm commented 7 years ago

@mkiol Looks like it's fixed

mkiol commented 7 years ago

@davejm Cool :-) If you found any other bugs, please report them. Thanks.