Subscription request to offline user protocol bug

Hi,

I’‘ve been playing around with the new alpha 4 build, and in particular testing the new implementation of handling subscription requests to offline users. I’'ve noticed a discrepancy in the protocol between sending subscription requests to online and offline users, which is affecting my client.

If user A sends user B a subscription request when user B is online, user B receives the subscription request without any roster pushes from the server that contain user A in the list (which makes sense since user B has not added user A to the roster yet).

However, suppose user A sends user B a subscription request when user B is offline. When user B comes online, he receives a roster push with user A contained in his roster (with subscription=“none”), even though he has not yet added him. He then receives the subscription request from user A.

I don’‘t think that user A should be in user B’'s roster list until

  1. user B has either added user A, or

  2. user B has granted subscription to user A.

I think the offline case should be more like the online case, in that user A should not be in user B’'s roster before user B even receives or grants the subscription request.

Please let me know what you think…

Thanks

You’‘re absolutely right. That’‘s a bug in the implementation. Expect a fix in Alpha 5. If anyone needs a patch sooner, let me know via email and I’'ll try to send you a quick fix.

I’‘m having trouble replicating the bug. My experiments with Exodus appear to be giving me the proper behavor. Could you turn stream logging on for your server and send me the trace of the bug you’'re seeing or post it to the forum?

thanks

-iain

Sure. In the following transaction, “cbartlett” was offline. “ananner” then decides to subscribe to “cbartlett”. “cbartlett” comes online. You will see that “ananner” is in his initial roster update with a subscription of “none”.


I] 2/12/03 5:22 PM <presence xmlns=“jabber:client” type=‘‘subscribe’’ id=‘‘id_10045’’ to=‘‘cbartlett@clymene’’></p

resence>

2/12/03 5:22 PM <item jid=“cbartlett@clymene” subscription

=“none” ask=“subscribe” name=“Bart”/>

2/12/03 5:22 PM <?xml version="1.0" encoding="UTF-8" ?><stream:stream to=“clymene” xmlns=“jabber:client”

xmlns:stream=“http://etherx.jabber.org/streams”>

2/12/03 5:22 PM <stream:stream xmlns=‘‘jabber:client’’ xmlns:stream=‘‘http://etherx.jabber.org/streams’’ from

=‘‘clymene’’ id=‘‘67691d73’’>

2/12/03 5:22 PM <iq xmlns=“jabber:client” type=‘‘get’’ id=‘‘id_10125’’><usernam

e>cbartlett

2/12/03 5:22 PM cb

artlett

2/12/03 5:22 PM <iq xmlns=“jabber:client” type=‘‘set’’ id=‘‘id_10127’’><usernam

e>cbartlettpasswordHome</qu ery>

2/12/03 5:22 PM

2/12/03 5:22 PM <iq xmlns=“jabber:client” type=‘‘get’’ id=‘‘id_10129’’></iq

2/12/03 5:22 PM <query xmlns="

jabber:iq:roster"><it

em jid=“ananner@clymene” subscription=“none”/>

2/12/03 5:22 PM

2/12/03 5:22 PM <presence xmlns=“jabber:client” type=‘‘available’’ id=‘‘id_10130’’><priority xmlns="jabber:cl

ient">1

2/12/03 5:22 PM

2/12/03 5:22 PM <presence xmlns=“jabber:client” type=‘‘subscribe’’ id=‘‘id_10132’’ to=‘‘ananner@clymene’’></pre

sence>

2/12/03 5:22 PM <presence type=“subscribe” id=“id_10132” to=“ananner@clymene” from="cbartlett@clymene/Hom

e"/>

2/12/03 5:22 PM <item jid=“ananner@clymene” subscription="

none" ask=“subscribe”/>

2/12/03 5:22 PM <item jid=“cbartlett@clymene” subscription

=“none” ask=“subscribe” name=“Bart”/>

Cool. I understand now. It’'s fixed for Alpha 5.