Projects tigase _server tigase-pubsub Issues #107
disco#items feature returned on disco#info request for PubSub node item (#107)
Andrzej Wójcik (Tigase) opened 4 years ago

There is nothing more inside PubSub node item, so it should not return disco#items as a supported feature. Currently, as it is returned, clients think that they should query subitems and as PubSub node item has no node attribute in disco result are quering PubSub component nodes once again.

<iq to='pubsub.tigase.org' type='get' id='36ACF6DC-283D-45BE-A1A1-32240653340C'>
<query xmlns='http://jabber.org/protocol/disco#items' node='temperature_in_my_house'/>
</iq>

<!--   2020-08-20T08:56:29Z   <<<<   -->
<iq from='pubsub.tigase.org' id='36ACF6DC-283D-45BE-A1A1-32240653340C' xmlns='jabber:client' to='andrzej.wojcik@tigase.org/1835190798-tigase-202' type='result'>
<query xmlns='http://jabber.org/protocol/disco#items' node='temperature_in_my_house'>
<item name='6r3c89huk6zutvqpjhc' jid='pubsub.tigase.org'/>
<item jid='pubsub.tigase.org' name='2abgef744b37crs763y'/>
</query>
</iq>

<!--   2020-08-20T08:56:29Z   >>>>   -->
<iq id='A23F0B6A-3ED6-4A45-A4B2-EFFC5241E814' to='pubsub.tigase.org' type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

<!--   2020-08-20T08:56:29Z   >>>>   -->
<iq type='get' id='C7677D91-8F35-4ABD-895B-2394FD07759C' to='pubsub.tigase.org'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

<!--   2020-08-20T08:56:29Z   >>>>   -->
<r xmlns='urn:xmpp:sm:3'/>

<!--   2020-08-20T08:56:29Z   <<<<   -->
<a h='192' xmlns='urn:xmpp:sm:3'/>

<!--   2020-08-20T08:56:29Z   <<<<   -->
<iq xmlns='jabber:client' from='pubsub.tigase.org' id='A23F0B6A-3ED6-4A45-A4B2-EFFC5241E814' type='result' to='andrzej.wojcik@tigase.org/1835190798-tigase-202'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity category='pubsub' type='service' name='PubSub acs-clustered'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-default'/>
<feature var='http://jabber.org/protocol/pubsub#purge-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#subscribe'/>
<feature var='http://jabber.org/protocol/pubsub#member-affiliation'/>
<feature var='http://jabber.org/protocol/pubsub#subscription-notifications'/>
<feature var='http://jabber.org/protocol/pubsub#create-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#outcast-affiliation'/>
<feature var='http://jabber.org/protocol/pubsub#get-pending'/>
<feature var='http://jabber.org/protocol/pubsub#presence-notifications'/>
<feature var='urn:xmpp:ping'/>
<feature var='http://jabber.org/protocol/pubsub#delete-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#config-node'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-items'/>
<feature var='http://jabber.org/protocol/pubsub#access-whitelist'/>
<feature var='http://jabber.org/protocol/pubsub#access-presence'/>
<feature var='http://jabber.org/protocol/disco#items'/>
<feature var='urn:xmpp:mam:1'/>
<feature var='http://jabber.org/protocol/pubsub#instant-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#modify-affiliations'/>
<feature var='http://jabber.org/protocol/pubsub#multi-collection'/>
<feature var='http://jabber.org/protocol/pubsub#create-and-configure'/>
<feature var='http://jabber.org/protocol/pubsub#publisher-affiliation'/>
<feature var='http://jabber.org/protocol/pubsub#access-open'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-affiliations'/>
<feature var='http://jabber.org/protocol/pubsub#access-authorize'/>
<feature var='jabber:iq:version'/>
<feature var='http://jabber.org/protocol/pubsub#retract-items'/>
<feature var='http://jabber.org/protocol/pubsub#manage-subscriptions'/>
<feature var='http://jabber.org/protocol/commands'/>
<feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/>
<feature var='http://jabber.org/protocol/pubsub#publish-options'/>
<feature var='http://jabber.org/protocol/pubsub#access-roster'/>
<feature var='http://jabber.org/protocol/pubsub#publish'/>
<feature var='http://jabber.org/protocol/pubsub#collections'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-subscriptions'/>
<feature var='http://jabber.org/protocol/disco#info'/>
<x type='result' xmlns='jabber:x:data'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/network/serverinfo</value>
</field>
<field var='abuse-addresses' type='text-multi'>
<value>mailto:support@tigase.net</value>
<value>xmpp:tigase@muc.tigase.org</value>
<value>https://tigase.tech/projects/tigase-xmpp-installations</value>
</field>
</x>
</query>
</iq>

<!--   2020-08-20T08:56:29Z   <<<<   -->
<iq xmlns='jabber:client' from='pubsub.tigase.org' id='C7677D91-8F35-4ABD-895B-2394FD07759C' type='result' to='andrzej.wojcik@tigase.org/1835190798-tigase-202'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity type='service' category='pubsub' name='PubSub acs-clustered'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-default'/>
<feature var='http://jabber.org/protocol/pubsub#purge-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#subscribe'/>
<feature var='http://jabber.org/protocol/pubsub#member-affiliation'/>
<feature var='http://jabber.org/protocol/pubsub#subscription-notifications'/>
<feature var='http://jabber.org/protocol/pubsub#create-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#outcast-affiliation'/>
<feature var='http://jabber.org/protocol/pubsub#get-pending'/>
<feature var='http://jabber.org/protocol/pubsub#presence-notifications'/>
<feature var='urn:xmpp:ping'/>
<feature var='http://jabber.org/protocol/pubsub#delete-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#config-node'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-items'/>
<feature var='http://jabber.org/protocol/pubsub#access-whitelist'/>
<feature var='http://jabber.org/protocol/pubsub#access-presence'/>
<feature var='http://jabber.org/protocol/disco#items'/>
<feature var='urn:xmpp:mam:1'/>
<feature var='http://jabber.org/protocol/pubsub#instant-nodes'/>
<feature var='http://jabber.org/protocol/pubsub#modify-affiliations'/>
<feature var='http://jabber.org/protocol/pubsub#multi-collection'/>
<feature var='http://jabber.org/protocol/pubsub#create-and-configure'/>
<feature var='http://jabber.org/protocol/pubsub#publisher-affiliation'/>
<feature var='http://jabber.org/protocol/pubsub#access-open'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-affiliations'/>
<feature var='http://jabber.org/protocol/pubsub#access-authorize'/>
<feature var='jabber:iq:version'/>
<feature var='http://jabber.org/protocol/pubsub#retract-items'/>
<feature var='http://jabber.org/protocol/pubsub#manage-subscriptions'/>
<feature var='http://jabber.org/protocol/commands'/>
<feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/>
<feature var='http://jabber.org/protocol/pubsub#publish-options'/>
<feature var='http://jabber.org/protocol/pubsub#access-roster'/>
<feature var='http://jabber.org/protocol/pubsub#publish'/>
<feature var='http://jabber.org/protocol/pubsub#collections'/>
<feature var='http://jabber.org/protocol/pubsub#retrieve-subscriptions'/>
<feature var='http://jabber.org/protocol/disco#info'/>
<x type='result' xmlns='jabber:x:data'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/network/serverinfo</value>
</field>
<field type='text-multi' var='abuse-addresses'>
<value>mailto:support@tigase.net</value>
<value>xmpp:tigase@muc.tigase.org</value>
<value>https://tigase.tech/projects/tigase-xmpp-installations</value>
</field>
</x>
</query>
</iq>
Andrzej Wójcik (Tigase) commented 4 years ago

The issue is actually a little more complex. According to XEP-0030 it is possible to query any item returned by disco#items, so client may query with disco#info items returned by PubSub node.

However, XEP-0030 provides a way to limit queries (to inform client that query for info of a PubSub node item is not supported) by adding to the PubSub node disco#info response <identity category='hierarchy' type='leaf'/> which mean that this disco item is may not contain any more subitems (just entries which are not queryable).

The solution here is to add to PubSub support for identity of category hierarchy and to add proper support for that to the clients.

@bmalkow I think this will solve your issue which you have seen in BeagleIM when it was possible to expand items which would list all PubSub nodes leading to the infinite loop of nodes and items.

wojciech.kapcia@tigase.net commented 4 years ago

@andrzej.wojcik after our discussion (and your example about running a query against main server domain) it occurred to me that we may review our handling of discovery and add those identities in all relevant places (if missing) and not only in pubsub.

And one more comment - we do currently already send <identity type='leaf' category='pubsub'/> in pubsub, which informs the client that returned <item/>s should not be queried further, however adding category defined in xep-0030 will make it even more compatible (with clients that may not understand pubsub semantics defined in xep-0060)

Andrzej Wójcik (Tigase) commented 4 years ago

If I'm correct, we have done everything we could on the server side and the issue was fixed in BeagleIM by adding a few checks.

wojciech.kapcia@tigase.net commented 4 years ago

AFAIR the idea was to add (as mentioned in https://xmpp.org/extensions/xep-0030.html#items-hierarchy) category identity for collections and leafs: <identity category='hierarchy' type='branch'/> and <identity category='hierarchy' type='leaf'/> respectively, to make clients unaware of pubsub semantics also being able to handle those cases correctly.

I'm not sure if there are other places that may require it (MUC comes to mind, but AFAIR Bartosz made some fixes a while back and most likely it's handled correctly, but checking it out wouldn't hurt)

Andrzej Wójcik (Tigase) commented 4 years ago

As I've checked, MUC works fine and hierarchy was added to PubSub already.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0
Spent time
2h 45m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-pubsub#107
Please wait...
Page is in error, reload to recover