uralplan / psi-dev

Automatically exported from code.google.com/p/psi-dev
0 stars 0 forks source link

online contacts appear offline when their presence is sent before psi sends initial presence to server #596

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Шаги по воспроизведению проблемы:
What steps will reproduce the problem?

1. Add an account for Facebook XMPP chat
2. Set online status.

Каков ожидаемый результат?
What is the expected output?

Online contacts appear in the roster.

Что Вы видите вместо этого?
What do you see instead?

Online contacts do appear in the roster, but only for a short while before the 
connecting process finishes (approx. 1-2s).  After that they are switched to 
offline.  All contacts remain offline till further status change (even though 
they are really shown online on the Facebook web chat or in other XMPP clients 
connected to Facebook chat).

Какую версию Psi+ / ОС Вы используете?
What version of the Psi+/OS are you using?

Psi+ v0.16.406-435 (20141016), package from Launchpad repository used on Debian 
GNU/Linux (stable/testing/unstable mix).

Дополнительная информация по проблеме:
Additional information:

After analysing the XML exchange, it seems that regular/full XMPP server 
usually sends user's contacts presence AFTER the initial presence stanza is 
received from the user's client. Some servers (especially Facebook XMPP 
implementation) do not wait for the initial presence stanza to be sent and send 
the contacts presence BEFORE, and ONLY ONCE – so after the initial presence 
is received from the client the server does not respond with sending available 
contacts presence stanzas.

Psi+ (as far as my experience and external analysis goes) probably EXPECTS the 
server to send presence stanzas after it sends user's initial presence to the 
server and sets contacts status accordingly.  If the server does not at this 
moment send any presence stanzas, all contacts are treated as "unavailable". 
(This explains the short moment of online contacts being shown and then 
switched to offline.)

From my understanding of the XMPP RFC specification the server is not obliged 
to send the contact presence stanzas as a response to receiving initial 
presence from the client. So the PRESUPPOSITION that it is always or must be so 
is false and results in both potential and actual bug in Psi.

Original issue reported on code.google.com by jan.jan...@snilek.cz on 19 Oct 2014 at 8:03

GoogleCodeExporter commented 8 years ago
As we can see here http://xmpp.org/rfcs/rfc6121.html#session server sends 
contact's presences after initial presence. So Psi behaves right and the bug in 
FaceBook's server.

Original comment by wadea...@gmail.com on 19 Oct 2014 at 2:50

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yes, but that is just a one particular sample.  The actual specs for processing 
presence are in section 4 here:
http://xmpp.org/rfcs/rfc6121.html#presence

The conclusion I made in the report above is from that section, which indeed 
does not state, that the server has to return the presence of all user's 
contacts, but states only that it has to broadcast the presence of the user to 
all his/hers contacts.

Receiving the contacts presence can thus happen any time at all (though of 
course the rational setting is to respond with contacts presence after initial 
presence is sent by the client).

I may be missing something, bud the specs on this seem to me quite vague and 
benevolent (and that is the reason I report this issue here and not to Facebook 
devels).

Original comment by jan.jan...@snilek.cz on 19 Oct 2014 at 3:16