Lose owner subscription after node created using PubSub REST API

Kelly Kuang
Added about 3 years ago

I want to create a node using PubSub REST API. After request, the node has been created. But the owner subscription does not exist.

I confirm that If create a node using request, the Tigase server will create a node with the owner subscription.

I check the groovy\tigase\admin\CreateNode.groovy

pubsubRepository.createNode(toJid, node, owner,
    nodeConfig, nodeType, collection);

def nodeaAffiliations  = pubsubRepository.getNodeAffiliations(toJid, node);

pubsubRepository.update(toJid, node, nodeaAffiliations);

and java\tigase\pubsub\modules\

getRepository().createNode(toJid, nodeName, packet.getStanzaFrom().getBareJID(), nodeConfig, nodeType,
        (collection == null) ? "" : collection);

ISubscriptions nodeSubscriptions = getRepository().getNodeSubscriptions(toJid, nodeName);
IAffiliations nodeaAffiliations = getRepository().getNodeAffiliations(toJid, nodeName);

nodeSubscriptions.addSubscriberJid(packet.getStanzaFrom().getBareJID(), Subscription.subscribed);
nodeaAffiliations.addAffiliation(packet.getStanzaFrom().getBareJID(), Affiliation.owner);
getRepository().update(toJid, nodeName, nodeaAffiliations);
getRepository().update(toJid, nodeName, nodeSubscriptions);

In java code, It updates the node subscription. But in the groovy code, It does not.

Why does not update subscription in creating a node? It is just a bug?

Replies (1)

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Thank you for the submission, I've created an issue for it and added you as a watcher: #4071