Kostya,
I had observed this situation before, but hadn't paid attention how it was happening. Yesterday, I had a chance of taking a note about that.
I am on mobile network and the automatic synchronization is disabled through settings.
I am in the message-list view (Inbox). I manually sync by pulling and releasing at the top of the list. Aquamail syncs and gets one new message (actually, only the first 5 kB). There is a notification in the status bar for that message.
That seems to be a normal logic: new message yields a notification.
(Just in case: pulling down the notifications screen and pushing it back up didn't clear the notification.)
Lets compare it to a different "standard" scenario. A scheduled sync brings in two new messages, and a notification appears in the status bar (while I am not in Aquamail at all). I open the notification, and press on it. That gets me to the message list view. The notification is gone (yet before I open the actual message).
So, we get two different situations leading to the same state: being in the message-list view with new message(s), and in one case the notification is there, in the other, - not.
(I haven't seen if it would be the same if I had more than one message in the first case.)
Since that, I've actually tested that being on mobile network is irrelevant. It's only the sync (manual or automatic) happening while the screen is on and I am in the message-list view is what matters.
Yet another observation: switching off the screen and then switching it back on (thus getting back to the message list view) clears the notification. So, if syncing happened while the screen was off, but the phone was on the message-list view screen, unlocking the screen clears that notification off.
So, essentially, the apparent "inconsistency" is due to unlocking of the lock screen event clearing the message notification: If the screen is active, there is a notification, if a time out happens, and the screen lock comes on, the notification will not be there when I get back to that screen.
And there is a secondary "inconsistency": if you get to the message list view after the notification is posted, that clears that notification.
I see these possible solutions:
1. If Aquamail is on the message-list view of the particular folder (inbox), the notification should not be posted, or it is posted only for a limited period of time, if during that time you are still on that view.
If not:
2. The screen-lock opening (or whatever actually preceding that event) should not clear the notification. {*}
------
{*} I understand that from the OS/apps point of view, it is switching from a different app (screen lock) to Aquamail. But for the user it feels: I was in this view, I turned off the screen to save the battery while .... (or it timed out), and I am turning the phone on, so, I should be back in exactly the same state.
Obviously, this issue is very minor. But my OCD is voting for consistency.