Mail 2.0: ‘0 messages, 3 unread’

Posted by Pierre Igot in: Mail
December 22nd, 2005 • 6:26 pm

It’s the kind of stuff that has to be seen to be believed. So here it is:

0 messages, 3 unread

The question is: How does such a thing happen?

In this particular situation, it happened when I selected a thread of two messages in my Inbox and applied the “Remove Attachments” command to that thread while Mail was busy checking for new mail over my dial-up connection.

I guess I shouldn’t have done that but, you know, there’s nothing that says you can’t do that. On the contrary, Mail is a multi-threaded application and appears to be able to handle multiple concurrent tasks just fine.

Not in this case. As soon as I applied the “Remove Attachments” command to that thread, I knew that something was wrong. Mail behaved like it was removing the attachments from the messages in the thread, and deselected the messages, as usual—but the attachments were still there.

I know that sometimes the “Remove Attachments” command causes some “message list refresh” problems, so in order to force Mail to refresh the message list, I selected one of my individual account inboxes inside the main Inbox.

And that’s when I got the situation illustrated by the screen shot above. Mail clearly indicated that that particular mailbox contained three unread messages, but at the same time it also just as clearly indicated that the mailbox contained 0 message(s).

That situation never went away. I waited and waited and nothing happened. At some point, I checked the Activity Viewer window (which I keep open at all times, precisely because of weird situations like these), and saw this:

Sorting messages

So the reason why Mail was stuck in this impossible yet very real situation was that it was stuck in sorting mode and couldn’t complete the sorting task. Obviously, this had caused Mail’s threads to become out of sync, and part of Mail was thus stuck in a sorting process preventing it from listing any messages at all (hence the “0 messages”), while another part was not stuck at all and was perfectly able to see that that particular mailboxes contained “3 unread” messages.

It’s all well and good to have multi-threaded applications, but when out-of-sync situations like this one happen, it creates a pretty unsightly environment from a UI point of view.

And how was I supposed to get out of it? Well, since only part of Mail was stuck, there was no indication in the Mac OS X of Mail being “unresponsive.” Indeed, I could still pull down the menus, and click on various things, and the Dock menu for Mail was definitely not the menu you get when an application is not responding. It was the normal Mail Dock menu.

So I couldn’t select “Force Quit” in the Dock. If I tried the regular “Quit Mail” command in the “Mail” menu, it didn’t work either, because Mail refuses to quit until all processes are complete, and obviously this “Sorting messages” process was not complete.

In addition, the Activity Viewer showed that thread, but the “Stop” button (red stop sign icon) was greyed out, so there was no point in trying to click on that. What the use of a “Stop” button that cannot be clicked on is, I do not know. Obviously it makes sense to someone in Cupertino.

In the end, the only solution was to force quit the Mail application “manually” by going through the system-wide “Force Quit…” command in the Apple menu.

I don’t know what the average Mac user is supposed to do in such situations. In my experience, it’s already amazing if the average Mac user knows that, when an application is not responding, he can force-quit it through its Dock icon menu. But here, how is he supposed to know how to deal with a Mail application that is only partly not responding?

This situation raises all kinds of issues. How on earth can such a situation happen in the first place? And where are the proper interface behaviours to handle such situations gracefully for the user?

I am afraid it’s simply not acceptable. Yet, of course, since it’s not the kind of thing that is easy to reproduce (the next time I try to remove attachments in a thread of messages, it’ll probably work just fine), it’s pretty much pointless to report it to Apple as a bug.

Which raises another issue: How will such bugs ever get fixed if the bug reporting process is so heavily focused on easily reproducible situations? I didn’t make this particular situation up. It really did happen to me. And it happened in the course of using Mail. But I don’t know how to reproduce it reliably. Does it mean it’s not an important bug? I don’t think so… Yet right now, that’s exactly what it is.

It’s probably related to the more general flakiness of the “Remove Attachments” command per se. I experience problems with this command on a regular basis. The very fact that the command deselects the selected messages from which it has removed attachments is a clear indication that Apple simply hasn’t applied the usual standards to this particular command. It should be remembered that this command was added to Mail 1.3, as an afterthought. It was not included in earlier versions of the program. And it obviously still doesn’t work properly. But at this rate in 2008 it might still be as flaky as it is today. Which is really shameful.

13 Responses to “Mail 2.0: ‘0 messages, 3 unread’”

  1. danridley says:

    You can always force-quit an application from its Dock menu by holding Option; that’ll turn the “normal” Quit menu item into a Force Quit menu item. (There are arguments about the discoverability of the Option-holding thing, but it’s used widely in menus to do “the same thing, but bigger.” Option turns Minimize into Minimize All; Get Info into Show Inspector; Open With into Always Open With; Close Window into Close All Windows… In its favor, it’s visible; you can press and release Option and see the menu items change before your eyes.)

  2. Pierre Igot says:

    Thanks, wasn’t aware of this feature at all. Again, I don’t suspect many Mac users know about this. But it’s good to know :).

  3. danridley says:

    Oh, I should mention that in Finder, Ctrl also modifies the menu in one spot; changing Get Info into Get Summary Info. As far as I know, this is just a Finder weirdness, I haven’t seen Ctrl have similar behavior anywhere else.

    There’s another Finder uniqueness with the Option thing too: since it doesn’t have a “Quit” item on its Dock menu, you can’t open its Dock menu and then hit Option if you need to Relaunch it. Instead, you need to already have Option held down when you open its Dock menu, in which case Relaunch will appear. As far as I know, Finder is the only application where it matters whether you press Option before opening the menu, as opposed to after.

  4. Pierre Igot says:

    Interesting stuff :). I haven’t noticed the Control key modifying any menus anywhere else either. As for the Dock menu for the Finder itself, I suspect that the Option key can be used to modify menu items after pulling the menu down only if the changes don’t alter the actual layout of the menu. The “Relaunch” command that gets added when you option-click on the Finder’s Dock menu is actually a new command that is added to the bottom of the menu. Mac OS X is probably not designed to be able to redraw the entire menu after it’s been pulled down (or up in this particular case).

  5. Hawk Wings » Blog Archive » Betalogue: Two more annoyances says:

    […] Mail 2.0: ‘0 messages, 3 unread’ — By doing several complicated things at once, he brings’s multi-threading ability to its knees. It shouldn’t happen, it shouldn’t be so hard to discover that the app has stalled and it shouldn’t be so difficult to unstick it. […]

  6. Paul Ingraham says:

    I saw something similar to this bug at least six times in the space of a few hours last week when I was migrating from Entourage to Mail. I was able to quit, however, which is obviously a significant difference. Relaunching the application resolved the problem immediately each time.

    Nevertheless, it was a little creepy to see that “0 messages” every time it happened when I knew perfectly well that there were rather a lot more messages than that.

    I couldn’t reproduce the bug, but I was certainly doing some unusual operations that day, pushing the application fairly hard, creating and deleting a lot of folders, dragging and dropping huge selections, etc, all part of getting organizing — stuff I won’t be doing from day to day with Mail, but at the same time stuff that it really shouldn’t have trouble with. These kinds of operations may not be routine, but they are also occasionally essential.

    I migrated to Mail with my eyes wide open, expecting trouble… and I wasn’t disappointed.

  7. danridley says:

    Mail has always seemed vey lazy about keeping its message counts updated. I very frequently get mismatches like this temporarily; and it’s exacerbated by the fact that my IMAP server (which I run) is often overloaded and slow. So far, however, it’s always caught up to itself if I left it alone for 30 seconds or so.

  8. Pierre Igot says:

    I really don’t think that using a simple command such as Remove Attachments while Mail is checking for new mail in the background should have such disastrous consequences. My suspicion here is that I actually removed the attachments on a thread of messages that included a new message that had just arrived during the process of checking for new mail that Mail was still in the process of completing. The e-mail was already there visible in my Inbox, but maybe because the full mail checking process wasn’t complete yet (I have a dozen different accounts, which can take a little while over dial-up), something screwy happened because Mail was still in the process of “filtering” or recompiling the message list—even though, as I said, the message in question was already visible in the message list.

    In any case, the problem here is probably that Apple engineers spend very little time—if any—testing Mail with a dial-up connection. This kind of stuff never happens to them, because they check their e-mail accounts over broadband and the e-mail checking process gets completed in ittle time, given them very little opportunity to actually do something while the process is still in progress.

    It’s no excuse, but it’s probably the explanation for the persistence of such problems in Mail.

  9. Pierre Igot says:

    Dan: Yeah, I waited for several minutes in case this endless sorting process would eventually… sort itself out. But it never did. After five minutes, I felt I was entitled to a force-quit.

  10. MacMove says:

    Which raises another issue: How will such bugs ever get fixed if the bug reporting process is so heavily focused on easily reproducible situations? I didn’t make this particular situation up. It really did happen to me. And it happened in the course of using Mail. But I don’t know how to reproduce it reliably. Does it mean it’s not an important bug? I don’t think so… Yet right now, that’s exactly what it is.

    I think that being non-reproducable is a primary reason to categorize a bug as unimportant.

    Aside from the fact that non-reproducable bugs are a pain to troubleshoot (virtually impossible, actually), they deserve to be shuffled to the bottom of the pile. There are probably dozens of confirmed, reproducable bugs in Mail that deserve the attention of developers more than this one does!

  11. danridley says:

    Yeah, I was responding more to Paul Ingraham‘s comment there than to the main entry. I do think your issue was different (and your force quite was hard-earned).

  12. Paul Ingraham says:

    Dan: just to clarify, it wasn’t just my message count that was screwy… my messages were gone. Nothing at all in the message list. And no amount of waiting would solve the problem. “Waiting” was my first troubleshooting instinct, of course, but thirty seconds, two minutes, ten minutes… nothing was enough. Once I left it for 45 minutes while I went out to run an errand, and Mail was exactly as I had left it, with an empty message list and a zero message count. Definitely more than just sluggish message count updating!

  13. danridley says:

    Paul: Okay, I misread your message. Ignore me. <whistles nervously, tries to disappear>

Leave a Reply

Comments are closed.