Pubsub limitations remaining in SMACK 3.2 beta

We’ve been using a modified version of the 3.1 library for a while now. We had to make a few modifications to get it to work properly for us. In one case, there is an obvious pubsub bug that we had to fix. In others, the pubsub implementation had to be extended slightly to provide the information that we needed from certain events.

I’ve taken the liberty of creating a patch of these changes against the current smack trunk.

Here are the specific changes:

In smackx/pubsub/ConfigureForm, the setChildrenAssociationPolicy has a bug. It was setting a LIST value using a single string, when it should have been a list. I assume that no one else has ever used this method before because it will immediately throw an exception if you use it as it was. This fix, just places the requested policy into a list before setting the answer.

In smackx/pubsub/Item, the packet extension should include a node attribute. This has been added.

In smackx/pubsub/ItemDeleteEvent, there should be a list of affected nodes – in order to conform with collection node scenarios.

In smackx/pubsub/Node, the constructor calls to ItemDeleteEvent have to be updated accordingly when retracting a node.

In smackx/pubsub/PayloadItem, we added support for the node attribute.

In smackx/pubsub/RetractItem, we also added support for specifying the node.

With these changes, the smack library works properly with collection nodes.

Kingston Duffie
smackPubSub.patch.zip (2254 Bytes)

1 Like

Thanks for the patch. I will have to clarify that the changes are consistent with the version of the spec the API was written against before committing them all.

In the future could you break up patches for different issues please. More obvious and trivial issues can be applied quicker, not to mention that this should be reported as 2 different issues in jira.

Thanks.

Logged as SMACK-330

Robin,

Sorry for any hassle. I did, indeed, convolve two different things – the bug in setChildPolicyAssociation, and the support for nodeIds on various pubsub-related packets/objects. In future, I’ll separate these things.

Thanks for your help.

No problem.

You provided a patch and a very detailed explanation, so the “hassle” is more than worth it. Your efforts are appreciated.

I suppose this has not been fixed, since

form.setChildrenAssociationPolicy(ChildrenAssociationPolicy.whitelist);

gives “java.lang.IllegalArgumentException: This field is not of type String.”

This might be a really dumb question, how does one apply this patch? :expressionless:

Thanks

-s

The form issue is now fixed.

1 Like