"Ignoring roster push with not exaclty one entry." - Is this right?

Hi,

I am trying to connect to a tigase server, and read the roster, using a fresh copy of Smack 4.0.5.

After I connect, I get a “IQ Received” packet like this:

<item jid="user0000@group2.2.1" name="user0000" subscription="both">

  <group>Group Roster</group>

</item>

<item jid="user0001@group2.2.1" name="user0001" subscription="both">

  <group>Group Roster</group>

</item>

<item jid="user0002@group2.2.1" name="user0002" subscription="both">

  <group>Group Roster</group>

</item>

etc…

<item jid="user0019@group2.2.1" name="user0019" subscription="both">

  <group>Group Roster</group>

</item>

When Smack 4.0.5 sees this, it issues the warning:

WARNING: Ignoring roster push with not exaclty one entry. size=20

However, from RFC-3921:

  1. Roster Management

etc…

7.1. Syntax and Semantics

Rosters are managed using IQ stanzas, specifically by means of a

child element qualified by the ‘jabber:iq:roster’ namespace.

The element MAY contain one or more children, each

describing a unique roster item or “contact”.

So, this appears to state that the stanza is correct, and that the error is not valid:

Roster.java:1043

// A roster push must contain exactly one entry
Collection items = rosterPacket.getRosterItems();
if (items.size() != 1) {
LOGGER.warning(“Ignoring roster push with not exaclty one entry. size=” + items.size());
return;
}

So, I guess my question is, who is right? I can’t imagine that Smack has not been handling rosters correctly… Maybe it’s a configuration thing?

Thanks very much for any help!

Jamie.

Smack is right.

See RFC 6121 § 2.1.6 Roster Push:

The following rules apply to roster pushes:

  1. The element in a roster push MUST contain one and only one element.

I agree RFC 3921 is not very clear about it, but it’s obsolete long enough, that Tigase could have updated their implementation.

1 Like

Thanks for the reply!

I am seeing this issue as a result of a login.

In section 2.2 of the document you linked, “Retrieving the Roster on Login”, it shows an example of what I am getting from the server.

The example shows multiple items in the roster.

IQ Sent:

So I guess my question becomes, why is the IQ Received packet being interpreted as a roster push, when it is a result of a login?

In looking at the packets, it looks like the ID might not match the query ID.

In fact, it appears the server is replying with an empty roster, and then pushing a complete roster.

So… thanks for your help!

Jamie

Because it has type=“set” (which is a Roster Push, sent by the server), only one allowed here.

The example in the RFC has type=“result”, which is just the result to a client’s initiated request. Multiple allowed here.

Thank you very much!

I am seeing this issue as a result of a login.

In section 2.2 of the document you linked, “Retrieving the Roster on Login”, it shows an example of what I am getting from the server.

The example shows multiple items in the roster.

If you do get a type=“set” in response to a type=“get” request, but no type=“result” instead, then it’s a faulty implementation in Tigase and you should contact their developers.

But you should probably contact them anyway, because even if they send a “result”, their Roster Push (type=“set”) is flawed anyway.