Smack bug - AgentSession.setStatus()


I’ve found a bug with AgentSession.setStatus() in the smack API. After sending the presence packet to the chat server, the response is checked to see whether the returned presence is unavailable:

presence = (Presence)collector.nextResult(5000);
if (!presence.isAvailable()) {

throw new XMPPException(“No response from server on status set.”);

There are 2 problems here. Firstly, if no response is received from the server within 5 seconds, the returned presence will be null and a NullPointerException will occur. Secondly, the isAvailable() check doesn’t seem correct to me. Suppose you have 1 agent logged into a workgroup. If you call this method with a Presence mode of away or dnd, the next presence packet that is received is actually from the workgroup queue, with an unavailable status. Since there are no available agents (following the presence change), the queue is now unavailable.

The code appears to assume that the presence that is being sent will be echoed back by the workgroup, but this is not the case. The message in the exception would suggest that the exception should only be thrown if no response is received from the server within 5 seconds (i.e. presence is null).

I have attached a diff with a fix for this, which will prevent the exception being thrown in this scenario. Could this please be raised as a bug?

Many thanks,

Neil (433 Bytes)

Hi Neil,

Do you have a Jira account? If so, I’d be happy to set perms to allow you to post the Jira ticket. Please let me know your account name.


Shouldn’t this bug/patch go to Developers>Smack to make it visible to rcollier?

Apologies, this should have been in the Developers>Smack forum, since it’s a Smack bug rather than an issue with Openfire itself.

I have just created a Jira account with the name swordciboodle. I thought it would better to have a single account for the company I work for (Sword Ciboodle), since my colleagues may also wish to submit bugs.

Also, since my colleague (Stuart Chalmers) and I have now submitted a few patches, would it be possible to get svn commit access? Again, a single user would be preferrable so anyone from Sword Ciboodle could use it. We’re actually just about to release a new version of our software (which includes our text chat integration), so our support team will now be reponsible for dealing with any issues our text chat customers find.




I added that account to spark developers on Jira. As regards to svn access, it would be nice to have single accounts per person for accountability, but I can see your point. I’ll let others chime in with their thoughts.


I agree with Daryl, it should be one account per person. I would rather not see a variety of commits from different people under the same name.

Also, the current policy is to have a current contributor review the patches first and OK them before commit access is granted. This exercise becomes rather pointless if a group of people are using the same account, as there is no longer a way to judge the quality of the work.

Not to mention it becomes rather easy to have the account compromised.

On the Jira side though, I think it is fine to have the shared account. The only potential issue is if someone needs to contact the person who created the issue it becomes more difficult. This is just a minor annoyance though, not a showstopper.

Fair enough, I completely understand the concerns about a shared SVN account. Would I be able to get individual commit access?

For the Jira account, I could set the email address to be the mailing list of our support team, so that everyone would get any messages. That way, contacting the person who created issue shouldn’t be a problem.



I will try to review some of your contributions this weekend and we will take it from there. It’s great to have some new interest in the project so I will try to address this ASAP.