Uploaded image for project: 'ejabberd development'
  1. ejabberd development
  2. EJAB-672

Cannot explicitely create a collection node but it becomes one when a subnode is created

    Details

      Description

      If I try to create a collection node with this query (from 9.3 of XEP0060):
      http://www.xmpp.org/extensions/xep-0060.html#collections-createnode

      <iq type="set" from="test@example.net/SamePlace" to="pubsub.example.net" id="create">
        <pubsub xmlns="http://jabber.org/protocol/pubsub">
          <create node="/home/example.net/test/blabla"/>
          <configure>
            <x type="submit" xmlns="jabber:x:data">
              <field var="FORM_TYPE" type="hidden">
                <value>http://jabber.org/protocol/pubsub#node_config</value>
              </field>
              <field var="pubsub#node_type">
                <value>collection</value>
              </field>
            </x>
          </configure>
        </pubsub>
      </iq>
      

      I get:

      <iq from="pubsub.example.net" to="test@example.net/SamePlace" id="create" type="result">
        <pubsub xmlns="http://jabber.org/protocol/pubsub">
          <create node="/home/example.net/test/blabla"/>
        </pubsub>
      </iq>
      

      All seems ok, except that:

      <iq type="get" from="test@example.net/SamePlace" to="pubsub.example.net" id="nodes1">
        <query node="/home/example.net/test/blabla" xmlns="http://jabber.org/protocol/disco#info"/>
      </iq>
      
      <iq from="pubsub.example.net" to="test@example.net/SamePlace" id="nodes1" type="result">
        <query node="/home/example.net/test/blabla" xmlns="http://jabber.org/protocol/disco#info">
          <identity category="pubsub" type="leaf"/>
          <feature var="http://jabber.org/protocol/pubsub"/>
          <feature var="http://jabber.org/protocol/pubsub#access-open"/>
          <feature var="http://jabber.org/protocol/pubsub#collections"/>
          <feature var="http://jabber.org/protocol/pubsub#config-node"/>
          <feature var="http://jabber.org/protocol/pubsub#create-and-configure"/>
          <feature var="http://jabber.org/protocol/pubsub#last-published"/>
          <feature var="http://jabber.org/protocol/pubsub#presence-notifications"/>
          <feature var="http://jabber.org/protocol/pubsub#presence-subscribe"/>
          <feature var="http://jabber.org/protocol/pubsub#publisher-affiliation"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-default"/>
          <feature var="http://jabber.org/protocol/pubsub#create-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#auto-create"/>
          <feature var="http://jabber.org/protocol/pubsub#delete-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#instant-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#item-ids"/>
          <feature var="http://jabber.org/protocol/pubsub#manage-subscriptions"/>
          <feature var="http://jabber.org/protocol/pubsub#modify-affiliations"/>
          <feature var="http://jabber.org/protocol/pubsub#outcast-affiliation"/>
          <feature var="http://jabber.org/protocol/pubsub#persistent-items"/>
          <feature var="http://jabber.org/protocol/pubsub#publish"/>
          <feature var="http://jabber.org/protocol/pubsub#purge-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#retract-items"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-affiliations"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-items"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-subscriptions"/>
          <feature var="http://jabber.org/protocol/pubsub#subscribe"/>
          <feature var="http://jabber.org/protocol/pubsub#subscription-notifications"/>
        </query>
      </iq>
      

      So it creates a leaf node, even though it answered me at creation, it was OK! Normally if collection creation is impossible, it should fail with this:

      Example 206. Service does not allow creation of collection nodes

      <iq type='error'
          from='hamlet@denmark.lit/elsinore'
          to='pubsub.shakespeare.lit'
          id='config1'>
        <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
          <configure node='princely_musings'/>
        </pubsub>
        <error type='cancel'>
          <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
        </error>
      </iq>
      

      But in fact, it becomes a collection node if I create another node in it (collection or leaf, whatever):

      <iq type="set" from="test@example.net/SamePlace" to="pubsub.example.net" id="create">
        <pubsub xmlns="http://jabber.org/protocol/pubsub">
          <create node="/home/example.net/test/blabla/bla"/>
          <configure>
            <x type="submit" xmlns="jabber:x:data">
              <field var="FORM_TYPE" type="hidden">
                <value>http://jabber.org/protocol/pubsub#node_config</value>
              </field>
              <field var="pubsub#node_type">
                <value>collection</value>
              </field>
            </x>
          </configure>
        </pubsub>
      </iq>
        
      <iq from="pubsub.example.net" to="test@example.net/SamePlace" id="create" type="result">
        <pubsub xmlns="http://jabber.org/protocol/pubsub">
          <create node="/home/example.net/test/blabla/bla"/>
        </pubsub>
      </iq>
        
      <iq type="get" from="test@example.net/SamePlace" to="pubsub.example.net" id="nodes1">
        <query node="/home/example.net/test/blabla" xmlns="http://jabber.org/protocol/disco#info"/>
      </iq>
      
      <iq from="pubsub.example.net" to="test@example.net/SamePlace" id="nodes1" type="result">
        <query node="/home/example.net/test/blabla" xmlns="http://jabber.org/protocol/disco#info">
          <identity category="pubsub" type="collection"/>
          <feature var="http://jabber.org/protocol/pubsub"/>
          <feature var="http://jabber.org/protocol/pubsub#access-open"/>
          <feature var="http://jabber.org/protocol/pubsub#collections"/>
          <feature var="http://jabber.org/protocol/pubsub#config-node"/>
          <feature var="http://jabber.org/protocol/pubsub#create-and-configure"/>
          <feature var="http://jabber.org/protocol/pubsub#last-published"/>
          <feature var="http://jabber.org/protocol/pubsub#presence-notifications"/>
          <feature var="http://jabber.org/protocol/pubsub#presence-subscribe"/>
          <feature var="http://jabber.org/protocol/pubsub#publisher-affiliation"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-default"/>
          <feature var="http://jabber.org/protocol/pubsub#create-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#auto-create"/>
          <feature var="http://jabber.org/protocol/pubsub#delete-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#instant-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#item-ids"/>
          <feature var="http://jabber.org/protocol/pubsub#manage-subscriptions"/>
          <feature var="http://jabber.org/protocol/pubsub#modify-affiliations"/>
          <feature var="http://jabber.org/protocol/pubsub#outcast-affiliation"/>
          <feature var="http://jabber.org/protocol/pubsub#persistent-items"/>
          <feature var="http://jabber.org/protocol/pubsub#publish"/>
          <feature var="http://jabber.org/protocol/pubsub#purge-nodes"/>
          <feature var="http://jabber.org/protocol/pubsub#retract-items"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-affiliations"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-items"/>
          <feature var="http://jabber.org/protocol/pubsub#retrieve-subscriptions"/>
          <feature var="http://jabber.org/protocol/pubsub#subscribe"/>
          <feature var="http://jabber.org/protocol/pubsub#subscription-notifications"/>
        </query>
      </iq>
      

        Issue Links

          Expenses

            Activity

            Hide
            jehan Jehan Hysseo added a comment -

            This is linked to EJAB-668 I also created.
            It seems that the behaviour of ejabberd when one creates a node is to make it leaf (even though you explictely configured it as collection). And when you create a subnode, it becomes a collection. But if you create both a subnode and publish an item in it, it will be both a collection and a leaf (EJAB-668 case).

            Show
            jehan Jehan Hysseo added a comment - This is linked to EJAB-668 I also created. It seems that the behaviour of ejabberd when one creates a node is to make it leaf (even though you explictely configured it as collection). And when you create a subnode, it becomes a collection. But if you create both a subnode and publish an item in it, it will be both a collection and a leaf ( EJAB-668 case).
            Hide
            jsierles Joshua Sierles added a comment -

            I can confirm this behavior - it seems to be a specification violation since publishing options are not allowed on collection nodes: "therefore a collection MUST NOT support the "publish" feature or related features such as "persistent-items"

            Show
            jsierles Joshua Sierles added a comment - I can confirm this behavior - it seems to be a specification violation since publishing options are not allowed on collection nodes: "therefore a collection MUST NOT support the "publish" feature or related features such as "persistent-items"
            Hide
            cromain@process-one.net Christophe Romain added a comment -

            i also confirm this behavior which is inherited from previous version of the spec.
            this is now a spec violation and will be part of work done to make pubsub 1.12 compliant.

            Show
            cromain@process-one.net Christophe Romain added a comment - i also confirm this behavior which is inherited from previous version of the spec. this is now a spec violation and will be part of work done to make pubsub 1.12 compliant.
            Hide
            cromain@process-one.net Christophe Romain added a comment -

            collection node implementation is available now, EJAB-815 should fix that issue (to be checked)

            Show
            cromain@process-one.net Christophe Romain added a comment - collection node implementation is available now, EJAB-815 should fix that issue (to be checked)
            Hide
            cromain@process-one.net Christophe Romain added a comment -

            I close this issue as it duplicates EJAB-668 (it point the same problem in current implementation)
            EJAB-668 is more generic and will track work on that task.

            Show
            cromain@process-one.net Christophe Romain added a comment - I close this issue as it duplicates EJAB-668 (it point the same problem in current implementation) EJAB-668 is more generic and will track work on that task.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development