You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by [email protected], Jan 25, 2011
What steps will reproduce the problem?
Logout from the session
Connection error or disconnected
Relogin using this session
What is the expected output? What do you see instead?
On session relogin the Presence Manager should fire available. The PresenceManager doesn't fire available presence.
In source code the PresenceManager fire presence available if the session state is "rosterReady". But in XmppRosterLogin, the session rosterReady state is changed only once, based on boolean "rosterReady". May be, if you have missed to change the boolean "rosterReady" to false when the session state is loggginOut,error,disconnected.
What version of the product are you using? On what operating system?
The text was updated successfully, but these errors were encountered:
Comment 1 by project member danigb, Jan 25, 2011
Thanks! We will work on that one. Can you give more details about where in the source code is that bug? (patches welcomed)
Bests,
Dani
Comment 3 by [email protected], Jan 25, 2011
This patches sets the rosterReady flag to true. It is never changed eventhough the session is logout. The rosterReady flag is set in XmppRosterBoilerplate.java constructor and used in XmppRosterLogin.java. May this patches be clear????
code patches.
rosterReady is set to "true"
XmppRosterLogic.java
public void reRequestRoster() {
if (session.getCurrentUser() != null) {
IQ iq = new IQ(IQ.Type.get, null).WithQuery("jabber:iq:roster");
session.sendIQ("roster", iq, new IQResponseHandler() { @OverRide
public void onIQ(IQ iq) {
if (IQ.isSuccess(iq)) {
clearGroupAll();
final List<? extends IPacket> children = iq.getFirstChild("query").getChildren();
for (final IPacket child : children) {
final RosterItem item = RosterItem.parse(child);
storeItem(item);
}
if (!rosterReady) {
rosterReady = true;
session.setSessionState(SessionStates.rosterReady);
}
eventBus.fireEvent(new RosterRetrievedEvent(getItems()));
} else {
eventBus
.fireEvent(new RequestFailedEvent("roster request", "couldn't retrieve the roster", iq));
}
}
});
}
Hi,
The 'rosterReady' state is not only affecting the PresenceManager behavior. The important 'ready' state is also fired only once at your first login because it is fired right after the 'rosterReady' state is fired. In addition when you logout the roster is still ready which cannot be true. I don't know whether the actual patch was provided or not but here is the code for the patch:
XmppRosterLogic.java
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
session.addSessionStateChangedHandler(true, new StateChangedHandler() { @OverRide
public void onStateChanged(final StateChangedEvent event) {
if (event.is(SessionStates.loggedIn)) {
reRequestRoster();
} else if (event.is(SessionStates.disconnected)) { // +++ this was added +++
rosterReady = false; // +++ this was added +++
}
}
});
Best,
Vitaly
Reported by [email protected], Jan 25, 2011
What steps will reproduce the problem?
What is the expected output? What do you see instead?
On session relogin the Presence Manager should fire available. The PresenceManager doesn't fire available presence.
In source code the PresenceManager fire presence available if the session state is "rosterReady". But in XmppRosterLogin, the session rosterReady state is changed only once, based on boolean "rosterReady". May be, if you have missed to change the boolean "rosterReady" to false when the session state is loggginOut,error,disconnected.
What version of the product are you using? On what operating system?
The text was updated successfully, but these errors were encountered: