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

Temp icon files are removed too soon, causing icons to disappear in some notification servers #131

Closed anbenson closed 7 years ago

anbenson commented 8 years ago

I'm running firefox+gnotifier+dunst. When I get notifications with icons, the icon shows up but disappears whenever the notification is redrawn, apparently because the icon file was deleted. As an experiment, I tried changing the timeout for when temp icon files are deleted in main.js, and it fixed the issue.

Could we either extend the timeout by a lot, or put in a preference to set the timeout, or maybe just entirely remove the timeout to remove temp icon files? I notice that gnotifier removes temp icon files on addon unload - it looks like this happens whenever the browser is shutdown (among other reasons), so would "every time the browser is shutdown" be often enough?

mkiol commented 8 years ago

Thanks for the report. I agree with you, "timeout" is pointless, since all icons are removed when Firefox quits. Will be fixed in upcoming release.

dkadioglu commented 7 years ago

I would like to note that deletion only after closing Firefox may be not enough, if you keep Firefox running for days or weeks. On the one hand the total size of icons is constantly growing - this may not be a big problem though, at least not until Firefox is running for a longer time and many notifications are occuring (e.g. Webmail, RSS reader). On the other hand the tmp folder in Linux gets really cluttered - to overcome this the icons could go to some subfolder, maybe inside the temporary folder of Firefox /tmp/mozilla_username0/gnotifier.

mkiol commented 7 years ago

@dkadioglu I've uploaded new xpi (1.9.8-pre4). Temp icons are stored under /tmp/gnotifier. Additionally caching is improved, so new tmp file is created only for the icon that has not been previously downloaded. This should decrease number of tmp files.

mkiol commented 7 years ago

Fixed the latest AMO release - 1.9.8.

dkadioglu commented 7 years ago

Caching works really better now. Thanks!