Uploaded image for project: 'Smack'
  1. Smack
  2. SMACK-759

PubSubManager.getLeafNode() throws PubSubAssertionError.DiscoInfoNodeAssertionError if node exists but its not a PubSub Node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.3.0, 4.2.1
    • Component/s: Extensions
    • Labels:
    • Expected Effort:
      Medium

      Description

      I turns out there case when discovering pubsub nodes (XEP-0060 5.3) where the node exists, but is not a pubsub node. So the service will not return an <item-not-found/> error, but an result IQ without an <identity category='pubsub'/>. Smack's code does not currently account for that. This case is very unlikely, if not impossible on plain traditional PubSub services, but apparently not uncommon when PEP is used.

      Forces users to catch the PubSubAssertionError when querying PubSubNodes.

      For example, ejabberd will return a result IQ without <identity category='pubsub'/>:

      17:28:02 SENT (0): <iq to='myclient@ejabberd.srv' id='cq41A-75' type='get'><query xmlns='http://jabber.org/protocol/disco#info' node='invalid-node'></query></iq>
      17:28:03 RECV (0): <iq from='myclient@ejabberd.srv' to='myclient@ejabberd.srv/17165994385926269896640' id='cq41A-75' type='result'><query xmlns='http://jabber.org/protocol/disco#info' node='invalid-node'><identity category='account' type='registered'/></query></iq>

      Exception in thread "main" org.jivesoftware.smackx.pubsub.PubSubAssertionError$DiscoInfoNodeAssertionError: PubSub service 'myclient@ejabberd.srv' returned disco info result for node 'blabla', but it did not contain an Identity of type 'leaf' or 'collection' (and category 'pubsub'), which is not allowed according to XEP-60 5.3.
          at org.jivesoftware.smackx.pubsub.PubSubManager.getNode(PubSubManager.java:253)
          at org.jivesoftware.smackx.pubsub.PubSubManager.getLeafNode(PubSubManager.java:320)

       

      The confusing which lead the Smack developer to  assume that a result response must always contain an identity came from  XEP-0060 § 5.3 which states "The "disco#info" result MUST include an identity with a category of "pubsub" and a type of either "leaf" or "collection"." and here we see an IQ result without an identity. Furthermore XEP-0030 § 7 states that item-not-found jid+nodeId does not exists.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                flow Florian Schmaus
                Reporter:
                vanitasvitae vanitasvitae
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: