You are here

Buggy gTalk Server

Many odd things are going on with Google's gTalk server at gmail.com. One odd thing is that I get presence stanzas pushed to me by the server with my own full JID as the from attribute, at regular (?) times.

Another issue is that I am not allowed to send normal messages to myself, at least if I specify my bare JID as the to attribute according to the XMPP standards. However, if I set my full JID as the address, it gets delivered OK.

My investigations were started by some odd behavior of the subscription states. The scenario is this: Two contacts, A and B, with mutual subscriptions, which is the normal situation. If A sends an "unsubscribe" presence, B answers with "unsubscribed", and A has a subscription "from" and B a subscription "to". The XML looks like:

SEND: <presence type='unsubscribe' to='mats2@jabber.se' id='1002'/>
RECV: <iq to="matsben@gmail.com/CoccinellaFE0F3A06" 
        id="E620C358" 
        type="set">
    <query xmlns="jabber:iq:roster">
        <item jid="mats2@jabber.se" subscription="from"/>
    </query>
</iq>
RECV: <presence 
        from="mats2@jabber.se/Coccinella@hp"   
        to="matsben@gmail.com" 
        type="unavailable"/>

So far so good, but the gTalk server also pushes a stanza:

RECV: <iq 
        to="matsben@gmail.com/CoccinellaFE0F3A06" 
        id="E620C35A" type="set">
    <query xmlns="jabber:iq:roster">
        <item jid="mats2@jabber.se" subscription="from" ask="subscribe"/>
    </query>
</iq>

Where on Earth is the ask attribute coming from? The gTalk server somehow thinks it should be there if I only have a subscription from attribute. I haven't studied the RFC all that careful recently, but it seems like it tries to be smart, smarter than the standard, which will not go well.

Update:
I've found more oddities. If I join a room on a different server while being logged in to gtalk, that works fine until I start changing my presence in the room. If I also set the status tag and send this to the room like (shortened):

SEND: <presence to='test@conference.jabber.se'>
    <status>X</status>
RECV: <presence from="test@conference.jabber.se/matsben" 
         to="matsben@gmail.com/Coccinella685717FC">
    <status>X</status>
RECV: <presence from="test@conference.jabber.se/matsben" 
        to="matsben@gmail.com/Coccinella685717FC">
    <status>X</status>
RECV: <presence from="test@conference.jabber.se/matsben" 
        to="matsben@gmail.com/Coccinella685717FC" id="1001">

You see what happens. The first presence I receive is correct, the second is a duplicate, and the third has the status tag scratched.