Notifications stop appearing, and incorrect subject title shown in Unity dash Messaging menu

Bug #915341 reported by coversnail
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity Mail
Fix Released
High
Dmitry Shachnev

Bug Description

I have found that Unity-mail seems to work without fault initially, but after a while I notice that the pop-up notifications do not appear in the top right of the screen. Rebooting the system, or just going in: Change Account Details > Options, then clicking on apply will once again start the pop-ups appearing. Though they always seem to start after a while.

The unread messages counter on the launcher is always correct, and the mesage indicator in the dash is always correctly turned blue when there are unread messages. However if a look at the Messaging menu during the time that the pop-up notifications aren't working, then the subject titles listed in the unity-Mail section are incorrect and are of previous emails, not the currently unread ones.

I hope I've made my problem clear, I'm not sure what other infomation you might need from me but would be happy to provide system data if needed, I will keep an eye on this bug report. Sorry if it's just something dumb I've done to my system and not your fault at all! Thanks for the application, I very much enjoy using it and its very helpful!

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thank you for your report. Can you answer some questions?

- Which version of UM are you using (i.e. run "unity-mail --version")? Which version of Ubuntu?
- Did you suspend/hilbernate your machine before you got this bug?
- Are you sure that "counter is always correct"? (if something gets wrong, it should break as well) :)
- Finally, can you attach here your ~/.xsession-errors and ~/.xsession-errors.old (these are two hidden files in the home directory), when you get this bug (not after reboot!).

Changed in unity-mail:
status: New → Incomplete
importance: Undecided → High
Revision history for this message
coversnail (coversnail) wrote :

I'm running: Unity Mail, version 0.12.0.1
Using Ubuntu 11.10

- I don't hibernate my machine, though the bug can occur after resumed from a suspend, though I'm sure it also occurs if there has been no suspend. Will have to test more.

- The counter is always correct, which was what confused me! I've taken a screenshot (removed some parts for privacy) of my inbox, the launcher icon and messaging menu. The launcher icon shows correct number of unread inbox messages as does the dash menu, but the subject titles are wrong. (there are 4 messages in my spam folder, but these are not the emails that the dash messaging menu show either, the subject titles in the dash are previously recieved but deleted emails)

- I only had the one xsession-error file in my /home directory,there was no .old one there, have attached the one I had.

Hope this helps in some way, let me know if you need more info.

Revision history for this message
coversnail (coversnail) wrote :

Adding screen capture image?field.comment=Adding screen capture image

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

That's *very* strange... It seems that IDs of deleted mails and of those you really received are the same. How many mails do you have in regular Inbox and in Trash?

That's rather a bug in GMail or in python-imaplib, so I can't fix this on my side. But I hope emptying Trash folder will help you.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

And one more question:
- Can you mark a very old email in Inbox (if you have one) as unread (using GMail UI) and see what will happen (will notification appear or not)?

Revision history for this message
coversnail (coversnail) wrote :

At the moment I have quite a lot of mail in both. 1800 in inbox and 400 in the trash. Probably could do with a clear-out. On a fresh reboot of my system I sent myself an email 'Testing Testing' and marked my oldest inbox email (from Nov '09) subject title 'Thank you and Welcome'. I got notifications for both of them, though looking at the dash messaging menu the timestamps are way out.

I've attached a screengrab to show, the 'testing testing' email is only a few minutes old not a million hours so perhaps it doesn't like a certain date format?

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

This is even more strange...

I attached special debugging-enabled version of Unity Mail, can you run it, reproduce this bug (i.e. with sending a new "Testing Testing" mail) and paste its output to http://paste.ubuntu.com/? Also, please say what subject/time was displayed in the Messaging Menu after that.

To run it:
- open the Terminal
- enter "pkill -f unity-mail" to kill existing UM instance
- enter "python ~/Downloads/unity-mail.py" or where you downloaded it to
- if it's difficult for you to copy all the output, press Ctrl+C once, this won't kill it but will prevent it from printing more lines

Thank you for helping!

Revision history for this message
coversnail (coversnail) wrote :

Not sure I did everything correctly but here goes:

Output pasted here: http://paste.ubuntu.com/805138/

The correct subject title "Testing Testing" was shown in the messaging menu but the time was 1193045h

I'll try running it again at a point when its showing the wrong title in the messaging menu too.

Revision history for this message
coversnail (coversnail) wrote :

I've tried to run the debugging version twice when I have had the 'no notifications and wrong subject title' bug occuring. However running it always causes the next email to be recieved to be correctly notified and have the correct subject title in the Messaging menu. The time is always wrong though when doing this, and always 1193045h

Weird! I imagine its much more likely to be something I'm doing wrong somehow, just not sure what!

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

> 1193045h
Funny, that e-mail was sent in 1875! :) But googling shows that you're not alone.

Seriously speaking, I want to separate your bug into three issues:
1. Time is displayed incorrectly. As you can see in your output, UM receives the correct time, so problem is somewhere between UM and the Messaging Menu. I've tweaked UM to simplify time processing and added some more time-related output, please paste output of this version, too.
2. Notifications stop appearing (originally reported issue)
3. Wrong titles in Messaging Menu

You say that you can't reproduce (2) and (3) with my modified script. Can you still reproduce them with "normal" Unity Mail - which starts automatically for you?

Revision history for this message
coversnail (coversnail) wrote :

I've tried again witht eh latest script, this was the output: http://paste.ubuntu.com/805956/

The time in the messaging menu was still 1193045 h

I have still been getting the no notifications and wrong titles bug occuring. It always resolves itself if the script is run or I re-apply settings in the unity-mail account settings menu. I'll try today to keep the script runnning in the terminal and see if the bug occurs as everything always works initially but the bug seems to occur after a period of time.

Thanks for all the help, sorry if this is giving you a load of extra workload!

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

My modified script is based on bzr trunk, which has some minor differences from ppa package, maybe they fix your issue?
Wrongly-displayed time seems to be a bug in the Messaging Menu, I reported it as bug 917060.

Thank *you* for your help, sorry if this is giving *you* a load of extra workload! :)

Revision history for this message
coversnail (coversnail) wrote :

I've managed to reproduce the bug whilst having the script running in the terminal. All I did was to:

pkill -f unity-mail
python ~/Downloads/unity-mail.py (The latest version you uploaded)

then I left the terminal open and running in the background, not sure how long it had been running, probably 20 minutes and sent myself an email subject 'yet more testing' using my phone. This didn't recieve a pop-up notification so I took a screenshot. The launcher indicator is showing the current unread count, the messaging menu did its usual trick of wrong time and also has the wrong subject title.

After this I sent myself a further email from my phone 'testing 2' This did not recieve a notification either, though this time the messaging menu did have the correct subject title. I've posted the terminal output here: http://paste.ubuntu.com/806035/

the first screenshot is attached, the 2nd in the next comment.

Revision history for this message
coversnail (coversnail) wrote :

2nd screenshot

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

What you pasted is not the full log, but only last part of it (that fits the window size), so it's not useful :(

Please use Gnome-Terminal's Edit -> Select All and Edit -> Copy actions (if you run the script for 20 minutes, it should be a big amount of text!).

But there's one interesting detail in your second screenshot: when you received "Testing 2" (#1983) mail, it WAS ALREADY in the database!! So I can't understand at all how did it extract its title: if it had done it, it would have printed "processing mail ...". Most probably you already had a mail with "Testing 2" subject somewhere in Trash, or you had several unity-mail processes running (this shouldn't happen if you use pkill -f). Please confirm if one of my hypotheses is true.

Revision history for this message
coversnail (coversnail) wrote :

My fault sorry, I thought I had selected all! I ran the script again and had the bug occur immediately so hopefully this output may be more helpful: http://paste.ubuntu.com/806345/

The timeline of what I did is this:

-delete everything in spam and trash folders

-pkill and start script

-Send myself an email 'Test1' I also recieved another email at this point some junk about organic food!

-received notifications for both emails, timestamp was wrong in messaging menu again for both emails.

-deleted both emails from my inbox

-sent myself a second email 'Test2'

-got no notification, but unread counter in launcher changed to correct number, subject title in messaging menu was 'Test1'

-sent mself a third email 'Test3'

-got no notification, but unread counter in launcher changed to correct number, subject title in messaging menu was 'Organic food labelling'

-looking at the terminal script I could see that the new emails had been given the same numbers 1984 and 1985 as the first two emails so sent a fourth email to myself thinking it would be given number 1986 which hadn't been used yet.

-sent fourth email 'Test4'

- Recieved pop-up notification, launcher unread counter correct, correct subject title in messaging menu

-deleted all messages from inbox

-sent fifth email 'Test5'

-received no notification, launcher unread count correct, messaging menu subject title 'Test1'

Hope this can help, looks like if emails are deleted then unity-mail thinks the new ones are the actually still the old ones. Let me know if I did something wrong somewhere or you need more info

Revision history for this message
coversnail (coversnail) wrote :

Juat to add a further comment. When an incorrect subject title appears in the messaging menu the incorrect title can bethat of an email which has already been deleted AND removed from the trash folder.

From what I can gather, for me anyway, is that emails are being classified by their position in the inbox #1985, #1986 etc. and if an email is deleted and a new one received then I am getting the details for the previous email that has taken that position, and unity-mail assumes it has already been seen so doesn't acivate the pop-up notification. From the little research I have done (bearing in mind I'm not even remotely a programmer!) could it be possible that unity-mail is using sequential ID's for emails rather than unique ID's? I read this about imaplib which is where I'm basing this massive guess on: http://yuji.wordpress.com/2011/06/22/python-imaplib-imap-example-with-gmail/

Revision history for this message
Dmitry Shachnev (mitya57) wrote : Re: [Bug 915341] Re: Notifications stop appearing, and incorrect subject title shown in Unity dash Messaging menu

Yes, I've already understood this. I'll fix this later today.

status IN PROGRESS

Changed in unity-mail:
assignee: nobody → Dmitry Shachnev (mitya57)
status: Incomplete → In Progress
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I believe it's fixed now.

Package will soon be built in my test ppa, for now you can run the trunk version manually and confirm issues 2 and 3 are fixed.
Go to http://bazaar.launchpad.net/~mitya57/unity-mail/unity-mail/view/head:/unity-mail and click "download file", then run it using usual scheme.

Thanks for reporting this and helping me with debugging!

Changed in unity-mail:
status: In Progress → Fix Committed
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

So, can you confirm that this bug is fixed? A .deb package of Unity Mail 0.12.1 is available at https://launchpad.net/~mitya57/+archive/test1/+files/unity-mail_0.12.1_all.deb.

Revision history for this message
coversnail (coversnail) wrote :

Sorry for the slow reply, it took a while to work out how to install and I've been away a bit!

I can confirm that the problem is fixed with the new version (except for the time thing, but I've no idea whats casuing that!)

I have noticed a slight issue with the new version though it's not very important. Say you have three unread emails which you have been notified about. If you delete the oldest and the most recent, when unity-mail peforms its next check it will notify you for the 'middle' email again even if you have already recieved the notification previously.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Fixed now, the updated .deb file will soon become available at https://launchpad.net/~mitya57/+archive/test1/+files/unity-mail_0.12.2_all.deb.

Revision history for this message
coversnail (coversnail) wrote :

That's quick updating! Though in 0.12.2 I still get the same behaviour as described in comment #21 Will recieve a notification for the 'middle' email if earlier and later ones deleted. Its not really a problem in any way though.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

It's not a problem for you, but a big one for me.
Did you restart UM after upgrade (just open and close configuration
dialog to do that)? I'm pretty sure I fixed that in 0.12.2.

Revision history for this message
coversnail (coversnail) wrote :

Many apologies, I hadn't restarted UM after updating. Have tested and all the issue is fixed in the upgrade.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Copied package to main ppa.

Changed in unity-mail:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.