Project

General

Profile

Missing initial presence packets

Pankaj Sharma
Added over 2 years ago

Hi,

While troubleshooting a problem i stumbled upon a scenario where presence packets(in response to initial presence packet) were not being sent.

While diagnostic that below configurations were missing in the application which restricts presence packet to be sent to offline users:

@sess-man/plugins-conf/presence/skip-offline=false

sess-man/plugins-conf/presence/skip-offline-sys=false@

Upon some more troubleshooting it seems all the contacts in roster are present but the RosterElement.lastSeen is set to default value(10000) for some of the roster members.

Because this value is set to default the presence packets are not sent for these roster memebers as per the code below in RosterFlat.java

@public Element getCustomChild(XMPPResourceConnection session, JID buddy) throws NotAuthorizedException, TigaseDBException {

    RosterElement rel = getRosterElement(session, buddy);

    if (rel != null && rel.getLastSeen() > RosterElement.INITIAL_LAST_SEEN_VAL) {

        String stamp;

        synchronized (formatter) {

            stamp = formatter.format(new Date(rel.getLastSeen()));

        }

        return new Element("delay", new String[]{"stamp", "xmlns"}, new String[]{stamp, "urn:xmpp:delay"});

    }

    return null;

}@

Please help me understand when the roster value is set to default and why it is not being assigned proper value though the user in the roster element has logged in to the application in past? Also if there is any workaround the problem?


Replies (1)

Added by Wojciech Kapcia TigaseTeam over 2 years ago

Pankaj Sharma wrote:

While diagnostic that below configurations were missing in the application which restricts presence packet to be sent to offline users:

@sess-man/plugins-conf/presence/skip-offline=false

sess-man/plugins-conf/presence/skip-offline-sys=false@

Are those configuration options set when the problem manifests itself? Which version are you using? In the latest 7.1.0-SNAPSHOT presence plugin were split therefore those options may be ignored.

Please help me understand when the roster value is set to default and why it is not being assigned proper value though the user in the roster element has logged in to the application in past?

This information is stored in the user roster for all its contacts@, therefore it's essential that @contact's presence was received by the user (which implies, that the subscription also has to be correct between the two).

The value 10000 is the default for each RosterElement and is assigned when such object is created.

Also if there is any workaround the problem?

Please check the configuration and presence subscription.

    (1-1/1)