powered by Jive Software

Bug with pubsub in 4.1 Alpha 5 , works good in alpha 4

I am creating and configuring pubsub it works well in alpha 4. however in alpha 5.
with same configure form.

<iq id='Bd125-20' to='pubsub.ec2-75-101-132-5.compute-1.amazonaws.com' type='set'><pubsub xmlns='http://jabber.org/protocol/pubsub'><configure><x xmlns='jabber:x:data' type='submit'><field var='pubsub#access_model' type='list-single'><value>presence</value></field><field var='pubsub#publish_model' type='list-single'><value>publishers</value></field><field var='pubsub#deliver_payloads' type='boolean'><value>0</value></field><field var='pubsub#max_items' type='text-single'><value>3</value></field><field var='pubsub#node_type' type='list-single'><value>leaf</value></field><field var='pubsub#notify_config' type='boolean'><value>1</value></field><field var='pubsub#notify_delete' type='boolean'><value>1</value></field><field var='pubsub#notify_retract' type='boolean'><value>1</value></field><field var='pubsub#persist_items' type='boolean'><value>1</value></field><field var='pubsub#presence_based_delivery' type='boolean'><value>1</value></field></x></configure><create node='griffin:profile:919715224003:data'/></pubsub></iq> 11-04 17:29:37.149  11370-15106/com.griffin D/SMACK﹕ RCV (0): <iq from='pubsub.ec2-75-101-132-5.compute-1.amazonaws.com' to='919715224003@ec2-75-101-132-5.compute-1.amazonaws.com/F26A2705' type='error' id='Bd125-20'><pubsub xmlns='http://jabber.org/protocol/pubsub'><configure><x xmlns='jabber:x:data' type='submit'><field var='pubsub#access_model' type='list-single'><value>presence</value></field><field var='pubsub#publish_model' type='list-single'><value>publishers</value></field><field var='pubsub#deliver_payloads' type='boolean'><value>0</value></field><field var='pubsub#max_items' type='text-single'><value>3</value></field><field var='pubsub#node_type' type='list-single'><value>leaf</value></field><field var='pubsub#notify_config' type='boolean'><value>1</value></field><field var='pubsub#notify_delete' type='boolean'><value>1</value></field><field var='pubsub#notify_retract' type='boolean'><value>1</value></field><field var='pubsub#persist_items' type='boolean'><value>1</value></field><field var='pubsub#presence_based_delivery' type='boolean'><value>1</value></field></x></configure><create node='griffin:profile:919715224003:data'/></pubsub><error code='501' type='cancel'>
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>
11-04 17:29:39.324  11370-11370/com.griffin W/System.err﹕ feature-not-implemented
11-04 17:29:39.329  11370-11370/com.griffin W/System.err﹕ at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:197)
11-04 17:29:39.329  11370-11370/com.griffin W/System.err﹕ at org.jivesoftware.smack.PacketCollector.nextResultOrThrow(PacketCollector.java:178)
11-04 17:29:39.329  11370-11370/com.griffin W/System.err﹕ at org.jivesoftware.smackx.pubsub.PubSubManager.sendPubsubPacket(PubSubManager.java:316)

in alpha 4 it send

">>

and in alpha5 it send

">>

create node tags are changed causing to get feature not implemented error.

I’m not sure, but this look like a bug in the PubSub implementation. The order of the ‘create’ and ‘configure’ elements shouldn’t matter as far as I can tell.

May be its not the element order , i might be wrong . But it does fail in alpha 5 .

Also when i first create the node and the send the configuration form it sends malformed xml causing ejabberd to crash .

What can i provide you with to solve this problem ?

MoPad: EFNgaHbKcU

Can you point out the malformed XML in the stanza? Or isn’t that stanza that one which is reported as malformed? Right now I don’t see it.

Alpha 4 on create with form .

11-05 15:07:42.289 31826-31960/com.griffin D/SMACK﹕ SENT (0): presencepublishers03leaf1111

11-05 15:07:42.749 31826-31961/com.griffin D/SMACK﹕ RCV (0):

Alpha 5 on create with form .

11-05 16:14:15.049
7074-7245/com.griffin D/SMACK﹕ SENT (0): presencepublishers03leaf1111
11-05 16:14:15.409
7074-7247/com.griffin D/SMACK﹕ RCV (0): presencepublishers03leaf1111
11-05 16:14:15.454
7074-7074/com.griffin W/System.err﹕ feature-not-implemented

per

XEP-0060: Publish-Subscribe – Alpha 4 sends correct one but 5 doesnt.

The order of the ‘create’ and ‘configure’ elements shouldn’t matter as far as I can tell.

As per the XML schema in XEP-0060 it does:

xs:**sequence**
<xs:element ref=‘create’/>
<xs:element ref=‘configure’ minOccurs=‘0’/>
</xs:sequence>

in alpha 5 it sends

xs:**sequence**
<xs:element ref=‘configure’ minOccurs=‘0’/>

       <xs:element ref='create'/>

</xs:sequence>

Ahh, thanks for pointing this out @CSH

Fixed in 4.1.0-alpha6-SNAPSHOT with Use LinkedHashMap for PacketExtensions in Packet · 10643cc · Flowdalic/Smack · GitHub . @jeet please test and report back if it works or not.

Super … works thanks guys .

Interesting, that the and elements are treated as PacketExtension. I always thought a Packet in Smack corresponds to a stanza (or other 1st level stream element) in XMPP and a PacketExtension is therefore a direct child of it, no?

and a PacketExtension is therefore a direct child of it, no?

Not in case of IQs. PacketExtensions are here extension elements within the element underneath the IQ element. And if they appears also depends (currently) if IQ.getchildElementXML() calls getExtensionsXML().

I plan to change the IQ class so that PacketExtensions are always included in a future Smack version.

1 Like

Ok, but where is the malformed XML (besides the wrong order of elements)?