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

DAG plugin : Notifications not sent with pubsub#subscription_type=nodes subscription option

    Details

      Description

      With the 'dag' plugin, when a user is subscribed to a node with the "pubsub#subscription_type" = "nodes" subscription option, notifications are not sent.

        Activity

        Hide
        cromain@process-one.net Christophe Romain (Inactive) added a comment -

        The following nodes have been created :

        <iq type='set' to='pubsub.localhost'>                                                                                                                                                                         
          <pubsub xmlns='http://jabber.org/protocol/pubsub'>                                                                                                                                                          
           <create node='plays'/>                                                                                                                                                                                     
           <configure>                                                                                                                                                                                                
            <x xmlns='jabber:x:data' type='submit'>                                                                                                                                                                   
             <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>                                                                                                                                          
             <field var='pubsub#collection'><value/></field>                                                                                                                                                          
            </x>                                                                                                                                                                                                      
           </configure>                                                                                                                                                                                               
          </pubsub>                                                                                                                                                                                                   
        </iq>                                                                                                                                                                                                         
                                                                                                                                                                                                                      
        <iq type='set' to='pubsub.localhost'>                                                                                                                                                                         
          <pubsub xmlns='http://jabber.org/protocol/pubsub'>                                                                                                                                                          
           <create node='shakespeare'/>                                                                                                                                                                               
           <configure>                                                                                                                                                                                                
            <x xmlns='jabber:x:data' type='submit'>                                                                                                                                                                   
             <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>                                                                                                                                          
             <field var='pubsub#collection'><value>plays</value></field>                                                                                                                                              
            </x>                                                                                                                                                                                                      
           </configure>                                                                                                                                                                                               
          </pubsub>                                                                                                                                                                                                   
        </iq>                                                                                                                                                                                                         
                                                                                                                                                                                                                      
        <iq type='set' to='pubsub.localhost'>                                                                                                                                                                         
          <pubsub xmlns='http://jabber.org/protocol/pubsub'> 
           <create node='macbeth'/>                                                                                                                                                                                   
           <configure>                                                                                                                                                                                                
            <x xmlns='jabber:x:data' type='submit'>                                                                                                                                                                   
             <field var='pubsub#collection'><value>shakespeare</value></field>                                                                                                                                        
            </x>                                                                                                                                                                                                      
           </configure>                                                                                                                                                                                               
          </pubsub>                                                                                                                                                                                                   
        </iq>                                                                                                                                                                                                         
        

        Then a user subscribes to the 'plays' node :

        <iq type='set' to='pubsub.localhost'>                                                                                                                                                                         
          <pubsub xmlns='http://jabber.org/protocol/pubsub'>                                                                                                                                                          
            <subscribe node='plays' jid='foo@localhost'/>                                                                                                                                                             
          </pubsub>                                                                                                                                                                                                   
        </iq>                                                                                                                                                                                                         
        

        And configures it this way :

        <iq type='set' to='pubsub.localhost'>                                                                                                                                                                         
         <pubsub xmlns='http://jabber.org/protocol/pubsub'>                                                                                                                                                           
          <options node='plays' jid='foo@localhost'>                                                                                                                                                                  
           <x xmlns='jabber:x:data' type='submit'>                                                                                                                                                                    
            <field var='FORM_TYPE' type='hidden'>                                                                                                                                                                     
             <value>http://jabber.org/protocol/pubsub#subscribe_options</value>                                                                                                                                       
            </field>                                                                                                                                                                                                  
            <field  var="pubsub#subscription_depth" >                                                                                                                                                                 
             <value>all</value>                                                                                                                                                                                       
            </field>                                                                                                                                                                                                  
            <field var="pubsub#subscription_type" >                                                                                                                                                                   
             <value>nodes</value>                                                                                                                                                                                     
            </field>                                                                                                                                                                                                  
           </x>                                                                                                                                                                                                       
          </options>                                                                                                                                                                                                  
         </pubsub>                                                                                                                                                                                                    
        </iq>                                                                                                                                                                                                         
        

        Then a new node is created as a child of the 'plays' node :

        <iq type='set' to='pubsub.localhost'>                                                                                                                                                                         
          <pubsub xmlns='http://jabber.org/protocol/pubsub'>                                                                                                                                                          
           <create node='ionesco'/>                                                                                                                                                                                   
           <configure>                                                                                                                                                                                                
            <x xmlns='jabber:x:data' type='submit'>                                                                                                                                                                   
             <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>                                                                                                                                          
             <field var='pubsub#collection'><value>plays</value></field>                                                                                                                                              
            </x>                                                                                                                                                                                                      
           </configure>                                                                                                                                                                                               
          </pubsub>                                                                                                                                                                                                   
        </iq>                                                                                                                                                                                                         
        

        But the subscribed user doesn't receive any notification.
        However, it works when the user is subscribed with the following options :

        <iq type='set' to='pubsub.localhost'>                                                                                                                                                                         
         <pubsub xmlns='http://jabber.org/protocol/pubsub'>                                                                                                                                                           
          <options node='plays' jid='foo@localhost'>                                                                                                                                                                  
           <x xmlns='jabber:x:data' type='submit'>                                                                                                                                                                    
            <field var='FORM_TYPE' type='hidden'>                                                                                                                                                                     
             <value>http://jabber.org/protocol/pubsub#subscribe_options</value>                                                                                                                                       
            </field>                                                                                                                                                                                                  
            <field  var="pubsub#subscription_depth" >                                                                                                                                                                 
             <value>all</value>                                                                                                                                                                                       
            </field>                                                                                                                                                                                                  
            <field var="pubsub#subscription_type" >                                                                                                                                                                   
             <value>items</value>                                                                                                                                                                                     
            </field>                                                                                                                                                                                                  
           </x>                                                                                                                                                                                                       
          </options>                                                                                                                                                                                                  
         </pubsub>                                                                                                                                                                                                    
        </iq>                                                                                                                                                                                                         
        

        The user receives notifications of items published on a descendant node :

        <message from="pubsub.localhost" type="headline" to="foo@localhost" >                                                                                                                                         
         <event xmlns="http://jabber.org/protocol/pubsub#event">                                                                                                                                                      
          <items node="macbeth" >                                                                                                                                                                                     
           <item id="bnd81g37d61f49fgn581" >                                                                                                                                                                          
            <entry xmlns="http://www.w3.org/2005/Atom">                                                                                                                                                               
             <title>Soliloquy</title>                                                                                                                                                                                 
            </entry>                                                                                                                                                                                                  
           </item>                                                                                                                                                                                                    
          </items>                                                                                                                                                                                                    
         </event>                                                                                                                                                                                                     
         <headers xmlns="http://jabber.org/protocol/shim">                                                                                                                                                            
          <header name="Collection" >plays</header>                                                                                                                                                                   
         </headers>                                                                                                                                                                                                   
        </message>
        
        Show
        cromain@process-one.net Christophe Romain (Inactive) added a comment - The following nodes have been created : <iq type='set' to='pubsub.localhost'> <pubsub xmlns='http: //jabber.org/protocol/pubsub'> <create node='plays'/> <configure> <x xmlns='jabber:x:data' type='submit'> <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> <field var ='pubsub#collection'><value/></field> </x> </configure> </pubsub> </iq> <iq type='set' to='pubsub.localhost'> <pubsub xmlns='http: //jabber.org/protocol/pubsub'> <create node='shakespeare'/> <configure> <x xmlns='jabber:x:data' type='submit'> <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> <field var ='pubsub#collection'><value>plays</value></field> </x> </configure> </pubsub> </iq> <iq type='set' to='pubsub.localhost'> <pubsub xmlns='http: //jabber.org/protocol/pubsub'> <create node='macbeth'/> <configure> <x xmlns='jabber:x:data' type='submit'> <field var ='pubsub#collection'><value>shakespeare</value></field> </x> </configure> </pubsub> </iq> Then a user subscribes to the 'plays' node : <iq type='set' to='pubsub.localhost'> <pubsub xmlns='http: //jabber.org/protocol/pubsub'> <subscribe node='plays' jid='foo@localhost'/> </pubsub> </iq> And configures it this way : <iq type='set' to='pubsub.localhost'> <pubsub xmlns='http: //jabber.org/protocol/pubsub'> <options node='plays' jid='foo@localhost'> <x xmlns='jabber:x:data' type='submit'> <field var ='FORM_TYPE' type='hidden'> <value>http: //jabber.org/protocol/pubsub#subscribe_options</value> </field> <field var = "pubsub#subscription_depth" > <value>all</value> </field> <field var = "pubsub#subscription_type" > <value>nodes</value> </field> </x> </options> </pubsub> </iq> Then a new node is created as a child of the 'plays' node : <iq type='set' to='pubsub.localhost'> <pubsub xmlns='http: //jabber.org/protocol/pubsub'> <create node='ionesco'/> <configure> <x xmlns='jabber:x:data' type='submit'> <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> <field var ='pubsub#collection'><value>plays</value></field> </x> </configure> </pubsub> </iq> But the subscribed user doesn't receive any notification. However, it works when the user is subscribed with the following options : <iq type='set' to='pubsub.localhost'> <pubsub xmlns='http: //jabber.org/protocol/pubsub'> <options node='plays' jid='foo@localhost'> <x xmlns='jabber:x:data' type='submit'> <field var ='FORM_TYPE' type='hidden'> <value>http: //jabber.org/protocol/pubsub#subscribe_options</value> </field> <field var = "pubsub#subscription_depth" > <value>all</value> </field> <field var = "pubsub#subscription_type" > <value>items</value> </field> </x> </options> </pubsub> </iq> The user receives notifications of items published on a descendant node : <message from= "pubsub.localhost" type= "headline" to= "foo@localhost" > <event xmlns= "http: //jabber.org/protocol/pubsub#event" > <items node= "macbeth" > <item id= "bnd81g37d61f49fgn581" > <entry xmlns= "http: //www.w3.org/2005/Atom" > <title>Soliloquy</title> </entry> </item> </items> </event> <headers xmlns= "http: //jabber.org/protocol/shim" > <header name= "Collection" >plays</header> </headers> </message>
        Hide
        cromain@process-one.net Christophe Romain (Inactive) added a comment -

        attached proposed patch for master, to be tested

        Show
        cromain@process-one.net Christophe Romain (Inactive) added a comment - attached proposed patch for master, to be tested
        Hide
        cromain@process-one.net Christophe Romain (Inactive) added a comment -

        broadcast_created_node does not work cause SubsByDepth is always [

        {0,[]}

        ]
        i'm investigating that point

        Show
        cromain@process-one.net Christophe Romain (Inactive) added a comment - broadcast_created_node does not work cause SubsByDepth is always [ {0,[]} ] i'm investigating that point
        Hide
        cromain@process-one.net Christophe Romain (Inactive) added a comment -

        for the record
        on create node we use get_parentnodes_tree
        on publish item we use get_subnodes_tree

        Show
        cromain@process-one.net Christophe Romain (Inactive) added a comment - for the record on create node we use get_parentnodes_tree on publish item we use get_subnodes_tree
        Hide
        pandans pandans added a comment -

        Christophe Romain
        how can i get your result that when subscribe on parents and can get the notify from descendant node

        Show
        pandans pandans added a comment - Christophe Romain how can i get your result that when subscribe on parents and can get the notify from descendant node

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development