librelist archives

« back to archive

Roster problem after page reload using prebind

Roster problem after page reload using prebind

From:
shdk shdk
Date:
2014-05-27 @ 09:34
The first time I load the page and initialize converse everything works as
expected but after reloading the page and initializing converse again the
contact list gets loaded but all contacts are shown as offline.

I'm passing the right jid, sid and rid params. So I don't know what can be
causing this problem.

Any ideas?

Re: [conversejs] Roster problem after page reload using prebind

From:
Jc Brand
Date:
2014-05-27 @ 12:44
On Tue, May 27, 2014 at 11:34:58AM +0200, shdk shdk wrote:
>    The first time I load the page and initialize converse everything works as
>    expected but after reloading the page and initializing converse again the
>    contact list gets loaded but all contacts are shown as offline.
> 
>    I'm passing the right jid, sid and rid params. So I don't know what can be
>    causing this problem.

Are you sure that you are still logged in? Can you chat with other users, have
you checked your XMPP server's logs?

Re: [conversejs] Roster problem after page reload using prebind

From:
Alexandre Coloma
Date:
2014-05-27 @ 14:48
¿Are you stopping connection and attaching them after reload page?
I have the same problem , the only solution tha i see is reload contact
list,
 I think this bug is a important problem because chache connection in
reload page is important for good user experience.

Could be solved in converse.js project?
Thaks in advance for your patience

​

Re: [conversejs] Roster problem after page reload using prebind

From:
shdk shdk
Date:
2014-05-27 @ 15:05
yeah. I'm still logged in. I'm logging in as "admin" and there's already a
user called "user1" logged in I can see in the roster.

But if I reload the page (as "admin"), "user1 is shown as offline". If
"user1" changes the status to offline a then back to online, "admin"
These are the requests that are being sent to openfire:


This is the debug trace for the first time the page is loaded (everything
works right):


Attached
RosterItems initialized
Stored bare_jid
Backbone.LocalStorage.window.Store {name:
"06a29b97795387ffd28780afbe1e868ddaa777d0", records: Array[3], save:
function, create: function, update: function…}
Register callback done
r {cid: "c54", attributes: Object, collection: r, _changing: false,
_previousAttributes: Object…}
r {cid: "c56", attributes: Object, collection: r, _changing: false,
_previousAttributes: Object…}
0 : _throttledRequestHandler called with 0 requests
0 : _throttledRequestHandler called with 0 requests
0 : request id 1.0 posting
0 : request id 1.0 state changed to 1
<body rid="6693775200586884" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8">
    <iq type="get" id="8534:roster" xmlns="jabber:client">
        <query xmlns="jabber:iq:roster"></query>
    </iq>
    <presence xmlns="jabber:client"></presence>
</body>
0 : request id 1.1 state changed to 2
0 : request id 1.1 state changed to 3
0 : request id 1.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 0 requests
0 : request id 1 should now be removed
0 : request id 1.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind">
    <presence xmlns="jabber:client" id="j6n3P-56"
from="admin@desarrollo24/a2ec3ae8"
to="admin@desarrollo24/a2ec3ae8"></presence>
    <presence xmlns="jabber:client" from="user1@desarrollo24/b270071f"
to="admin@desarrollo24/a2ec3ae8"></presence>
    <iq xmlns="jabber:client" type="result" id="j6n3P-55"
to="admin@desarrollo24/a2ec3ae8">
        <query xmlns="jabber:iq:roster">
            <item jid="user2@desarrollo24" name="Usuario2 Apellidos
Usuario2" subscription="both">
                <group>Grupo</group>
            </item>
            <item jid="user1" name="user1" ask="subscribe"
subscription="none"></item>
            <item jid="user1@desarrollo24" name="Usuario1 Apellidos
Usuario1" subscription="both">
                <group>Grupo</group>
            </item>
        </query>
    </iq>
</body>
r {cid: "c56", attributes: Object, collection: r, _changing: true,
_previousAttributes: Object…}
1 : no requests during idle cycle, sending blank request
0 : request id 2.0 posting
0 : request id 2.0 state changed to 1
<body rid="6693775200586885" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8"></body>
0 : request id 2.1 state changed to 2
0 : request id 2.1 state changed to 3
0 : request id 2.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 0 requests
0 : request id 2 should now be removed
0 : request id 2.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind">
    <iq xmlns="jabber:client" type="result" id="8534:roster"
to="admin@desarrollo24/a2ec3ae8">
        <query xmlns="jabber:iq:roster">
            <item jid="user2@desarrollo24" name="Usuario2 Apellidos
Usuario2" subscription="both">
                <group>Grupo</group>
            </item>
            <item jid="user1" name="user1" ask="subscribe"
subscription="none"></item>
            <item jid="user1@desarrollo24" name="Usuario1 Apellidos
Usuario1" subscription="both">
                <group>Grupo</group>
            </item>
        </query>
    </iq>
    <presence xmlns="jabber:client" from="admin@desarrollo24/a2ec3ae8"
to="admin@desarrollo24/a2ec3ae8"></presence>
</body>
rosterHandler called
[Object, Object, Object]
1 : no requests during idle cycle, sending blank request
0 : request id 3.0 posting
0 : request id 3.0 state changed to 1
<body rid="6693775200586886" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8"></body>
0 : _throttledRequestHandler called with 1 requests
0 : _processRequest: first request has readyState of 1
0 : request id 4.0 posting
0 : request id 4.0 state changed to 1
<body rid="6693775200586887" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8">
    <presence xmlns="jabber:client"></presence>
</body>
0 : request id 3.1 state changed to 2
0 : request id 3.1 state changed to 3
0 : request id 3.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 1 requests
0 : _processRequest: first request has readyState of 1
0 : request id 3 should now be removed
0 : request id 3.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind"
ack="6693775200586887"></body>
0 : request id 4.1 state changed to 2
0 : request id 4.1 state changed to 3
0 : request id 4.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 0 requests
0 : request id 4 should now be removed
0 : request id 4.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind">
    <presence xmlns="jabber:client" from="admin@desarrollo24/a2ec3ae8"
to="admin@desarrollo24/a2ec3ae8"></presence>
</body>
1 : no requests during idle cycle, sending blank request
0 : request id 5.0 posting
0 : request id 5.0 state changed to 1
<body rid="6693775200586888" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8"></body>




And this is de debug trace after the page is reloaded (roster contacts are
shown as "offline"):


Attached
RosterItems initialized
Stored bare_jid
Backbone.LocalStorage.window.Store {name:
"06a29b97795387ffd28780afbe1e868ddaa777d0", records: Array[3], save:
function, create: function, update: function…}
Register callback done
r {cid: "c54", attributes: Object, collection: r, _changing: false,
_previousAttributes: Object…}
r {cid: "c56", attributes: Object, collection: r, _changing: false,
_previousAttributes: Object…}
0 : _throttledRequestHandler called with 0 requests
0 : _throttledRequestHandler called with 0 requests
0 : request id 1.0 posting
0 : request id 1.0 state changed to 1
<body rid="6693775200586894" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8">
    <iq type="get" id="1852:roster" xmlns="jabber:client">
        <query xmlns="jabber:iq:roster"></query>
    </iq>
    <presence xmlns="jabber:client"></presence>
</body>
0 : request id 1.1 state changed to 2
0 : request id 1.1 state changed to 3
0 : request id 1.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 0 requests
0 : request id 1 should now be removed
0 : request id 1.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind">
    <iq xmlns="jabber:client" type="result" id="1852:roster"
to="admin@desarrollo24/a2ec3ae8">
        <query xmlns="jabber:iq:roster">
            <item jid="user2@desarrollo24" name="Usuario2 Apellidos
Usuario2" subscription="both">
                <group>Grupo</group>
            </item>
            <item jid="user1" name="user1" ask="subscribe"
subscription="none"></item>
            <item jid="user1@desarrollo24" name="Usuario1 Apellidos
Usuario1" subscription="both">
                <group>Grupo</group>
            </item>
        </query>
    </iq>
</body>
rosterHandler called
[Object, Object, Object]
1 : no requests during idle cycle, sending blank request
0 : request id 2.0 posting
0 : request id 2.0 state changed to 1
<body rid="6693775200586895" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8"></body>
0 : request id 2.1 state changed to 2
0 : request id 2.1 state changed to 3
0 : request id 2.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 0 requests
0 : request id 2 should now be removed
0 : request id 2.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind">
    <presence xmlns="jabber:client" from="admin@desarrollo24/a2ec3ae8"
to="admin@desarrollo24/a2ec3ae8"></presence>
</body>
1 : no requests during idle cycle, sending blank request
0 : request id 3.0 posting
0 : request id 3.0 state changed to 1
<body rid="6693775200586896" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8"></body>
0 : _throttledRequestHandler called with 1 requests
0 : _processRequest: first request has readyState of 1
0 : request id 4.0 posting
0 : request id 4.0 state changed to 1
<body rid="6693775200586897" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8">
    <presence xmlns="jabber:client"></presence>
</body>
0 : request id 3.1 state changed to 2
0 : request id 3.1 state changed to 3
0 : request id 3.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 1 requests
0 : _processRequest: first request has readyState of 1
0 : request id 3 should now be removed
0 : request id 3.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind"
ack="6693775200586897"></body>
0 : request id 4.1 state changed to 2
0 : request id 4.1 state changed to 3
0 : request id 4.1 state changed to 4
0 : removing request
0 : _throttledRequestHandler called with 0 requests
0 : request id 4 should now be removed
0 : request id 4.1 got 200
<body xmlns="http://jabber.org/protocol/httpbind">
    <presence xmlns="jabber:client" from="admin@desarrollo24/a2ec3ae8"
to="admin@desarrollo24/a2ec3ae8"></presence>
</body>
1 : no requests during idle cycle, sending blank request
0 : request id 5.0 posting
0 : request id 5.0 state changed to 1
<body rid="6693775200586898" xmlns="http://jabber.org/protocol/httpbind"
sid="a2ec3ae8"></body>




2014-05-27 14:44 GMT+02:00 JC Brand <lists@opkode.com>:

> On Tue, May 27, 2014 at 11:34:58AM +0200, shdk shdk wrote:
> >    The first time I load the page and initialize converse everything
> works as
> >    expected but after reloading the page and initializing converse again
> the
> >    contact list gets loaded but all contacts are shown as offline.
> >
> >    I'm passing the right jid, sid and rid params. So I don't know what
> can be
> >    causing this problem.
>
> Are you sure that you are still logged in? Can you chat with other users,
> have
> you checked your XMPP server's logs?
>

Re: [conversejs] Roster problem after page reload using prebind

From:
Jc Brand
Date:
2014-05-28 @ 09:21
On Tue, May 27, 2014 at 05:05:02PM +0200, shdk shdk wrote:
>    yeah. I'm still logged in. I'm logging in as "admin" and there's already a
>    user called "user1" logged in I can see in the roster.

Can you send messages to "user1"?
  
>    But if I reload the page (as "admin"), "user1 is shown as offline". If
>    "user1" changes the status to offline a then back to online, "admin"

I'm struggling to understand your sentence above. You reload the page and your
roster contact "user1" is shown as offline. Then you change that user's status
to offline and online again. And then what happens? Does the status in the
roster change to online or does it stay offline?
 
>    These are the requests that are being sent to openfire:
> 
>    This is the debug trace for the first time the page is loaded (everything
>    works right):
  
<snip>
  
>    And this is de debug trace after the page is reloaded (roster contacts are
>    shown as "offline"):
 
Below is an IQ roster request stanza and a presence stanza. In other words, your
admin user has asked for his roster and has also advertised that he is online.

>    <body rid="6693775200586894"
>    xmlns="[10]http://jabber.org/protocol/httpbind" sid="a2ec3ae8">
>        <iq type="get" id="1852:roster" xmlns="jabber:client">
>            <query xmlns="jabber:iq:roster"></query>
>        </iq>
>        <presence xmlns="jabber:client"></presence>
>    </body>

Then the XMPP server responds with your roster. I see that there is a user with
jid "user1".

This is an invalid JID. Is that perhaps why you have a "user1" showing as
offline in your roster?

>    <body xmlns="[11]http://jabber.org/protocol/httpbind">
>        <iq xmlns="jabber:client" type="result" id="1852:roster"
>    to="admin@desarrollo24/a2ec3ae8">
>            <query xmlns="jabber:iq:roster">
>                <item jid="user2@desarrollo24" name="Usuario2 Apellidos
>    Usuario2" subscription="both">
>                    <group>Grupo</group>
>                </item>
>                <item jid="user1" name="user1" ask="subscribe"
>    subscription="none"></item>
>                <item jid="user1@desarrollo24" name="Usuario1 Apellidos
>    Usuario1" subscription="both">
>                    <group>Grupo</group>
>                </item>
>            </query>
>        </iq>
>    </body>

Here the XMPP server informs you of your own presence broadcast that you made a
while ago:
>    <body xmlns="[13]http://jabber.org/protocol/httpbind">
>        <presence xmlns="jabber:client" from="admin@desarrollo24/a2ec3ae8"
>    to="admin@desarrollo24/a2ec3ae8"></presence>
>    </body>

Here you broadcast your presence again:
 
>    <body rid="6693775200586897"
>    xmlns="[15]http://jabber.org/protocol/httpbind" sid="a2ec3ae8">
>        <presence xmlns="jabber:client"></presence>
>    </body>

And here the XMPP server informs you of your own presence broadcast:
>    <body xmlns="[17]http://jabber.org/protocol/httpbind">
>        <presence xmlns="jabber:client" from="admin@desarrollo24/a2ec3ae8"
>    to="admin@desarrollo24/a2ec3ae8"></presence>
>    </body>

Everything looks fine to me except for the fact that after you broadcast your
presence, you don't receive presence notifications from your roster contacts.

Generally, when you broadcast your presence, you should immediately get
presence notifications from your roster contacts, telling you what their chat
statuses are.

If you don't receive presence notifications from your contacts, then they must
be offline.

So either your roster contacts are really offline and you are mistaken to
believe they must be shown otherwise, or there is a subtle bug somewhere that I
am not aware of.

JC

Re: [conversejs] Roster problem after page reload using prebind

From:
Jc Brand
Date:
2014-05-28 @ 10:08
On Wed, May 28, 2014 at 11:21:51AM +0200, JC Brand wrote:

<snip>

> Below is an IQ roster request stanza and a presence stanza. In other words, your
> admin user has asked for his roster and has also advertised that he is online.
> 
> >    <body rid="6693775200586894"
> >    xmlns="[10]http://jabber.org/protocol/httpbind" sid="a2ec3ae8">
> >        <iq type="get" id="1852:roster" xmlns="jabber:client">
> >            <query xmlns="jabber:iq:roster"></query>
> >        </iq>
> >        <presence xmlns="jabber:client"></presence>
> >    </body>

Looking at this again, I remember a bug fixed in October last year where the
presence stanza was sent out too early.

https://github.com/jcbrand/converse.js/releases/tag/v0.6.6

What version of Converse.js are you using?