Starting with the rollout of Hangout as an update for gtalk (both inside gmail and as the android client) that happened around May, I noticed that I kept missing some messages and realizing someone tried to contact me only several days later.
The way I look for missed old messages is with the
label:chats of gmail.
Please note that I don't actually use Hangout (due to its well-known shortcomings): I reverted the gmail interface to the old one and disabled hangout notifications on android... instead I try to use XMPP clients as much as possible.
The last time that this happened was this morning: a friend wrote me before I connected my phone and I powered-up my tablet and pc (the pc was in standby with a browser tab containing gmail), so there was nothing connected that could've triggered Google to think: "I won't bother notifying the user for this message, since he already received it on a connected device"
Before the Hangouts app rollout, I saw the messages I missed when openining up gmail: they'd be open in the bottom right of the window and I'd often see them shown among the mails as well. Now there's no clue that someone tried to message me.
PS: I realized that the problem is indeed that I never appeared as offline to my contacts... I'm always at least away, but never offline.
I forced a sign out from other sessions in gmail, but this didn't affect anything
I tried to create another gtalk account, to chat with myself and debug the problem: this way I noticed that when I should be offline, I have 2 XMPP resources from which I'm connected.
Unfortunately, unlike gmail, ChatSecure and jitsi, who publish the application name in the resource name, these two follow the pattern
MessagingAxxxxxxxx (the x are hex characters). So I have no clue what could've possibly generated these resource names.
At last, I activated 2 factor authentication... this disconnected every account that I had connected, except for these 2 "phantom resources". I think that this is, as baffling as it is, proof that the problem is on Google's side, on their servers.