Muc.join() joins the room, but results in a NoResponseException

Platform: Android

Used libraries:

compile ‘org.igniterealtime.smack:smack-android:4.2.0-alpha2-SNAPSHOT’
compile ‘org.igniterealtime.smack:smack-android-extensions:4.2.0-alpha2-SNAPSHOT’
compile ‘org.igniterealtime.smack:smack-tcp:4.2.0-alpha2-SNAPSHOT’

My code relevant to establishing a connection:

AndroidSmackInitializer initializer = new AndroidSmackInitializer();
List exc = initializer.initialize();
if ( exc != null )

for ( Exception ex : exc )

Debug.log(ex);

XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration.builder()

.setConnectTimeout(5000)

.setHost(ServerConfig.HOST)

.setPort(ServerConfig.PORT)

.setDebuggerEnabled(true)

.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)

.setXmppDomain(JidCreate.domainBareFrom(“haber”))

.performSaslAnonymousAuthentication()

.setCompressionEnabled(false)

.setSendPresence(true)

.allowEmptyOrNullUsernames();

connection = new XMPPTCPConnection(config.build());

connection.connect()

username = “ǂAndro” + getRandomInt();
SASLAuthentication.registerSASLMechanism(new SASLAnonymous().instanceForAuthentication(connection));
connection.login();

;

The resulting connection object:

1/3 http://prntscr.com/844dbj

2/3 http://prntscr.com/844der

3/3 http://prntscr.com/844dh6

Then, I try to join a muc, like this:

MultiUserChat chat = MultiUserChatManager.getInstanceFor(connection)

.getMultiUserChat(JidCreate.entityBareFrom(ServerConfig.STARTUP_ROOM)); //startup_room = “haber@conference.etf.ba”

//chat is this http://prntscr.com/844e0v
chat.join(Resourcepart.from(username));

Now, on my web client, it says “ǂAndro645 has joined the room.”. And I can see the user on the online list, even message him (theh private chat works flawless)

But the chat.join() blocks for timeout (whici is 5000 ms) and then throws org.jivesoftware.smack.SmackException$NoResponseException

The full server-client conversation is in the attachment.

I hope this was detailed enough
sent-recv.txt.zip (2685 Bytes)

SASLAuthentication.registerSASLMechanism(new SASLAnonymous().instanceForAuthentication(connection));

That line appears to be a relic of practiced cargo cult programming. You should remove it.

I hope this was detailed enough

It would have been great if you had included the relevant stanza trace in your post and not the full trace containing a lot of noise as zipped attachment. That safes me a few clicks. Some goes for the exception and the full stack trace, which is only to be found if I download the Zip, extract and open it.

W/System.err﹕ org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Waited for response using: AndFilter: (FromMatchesFilter (ignoreResourcepart): haber@conference.etf.ba, StanzaTypeFilter: org.jivesoftware.smack.packet.Presence, MUCUserStatusCodeFilter: status=110).

It appears the MUC service does not send the self-presence (status=110). See xep45 example 22.

So, is there anything I could do?

The server is running openfire, and it isn’t my server so I can’t do any server edits (I could suggest something to the admin, but I have no direct access to the openfire admin panel)

And I’m confused how it worked on earlier versions of the library?

And I’m confused how it worked on earlier versions of the library?
Most likely the older version did not check for the self-presence. Maybe updating Openfire helps.

I talked to the admin, the openfire version is 3.9.1 which is confirmed to have a bug where it does NOT send that (its been fixed in 3.9.2, but they refuse to update, their motto is if it aint broke dont touch it)

Is it possible that I fork your current source and remove this part, without breaking too much?

Also, in MultiUserChat.checkAffiliationModifications()

there are a LOT of object.equals(otherObject) (e.g.

if (“owner”.equals(oldAffiliation) && !“owner”.equals(newAffiliation)) {

)

calls with inconvertible types, I could write a whole list of potential bugs like these. Was this reported before?

I could write a whole list of potential bugs

I wouldn’t call them *potential" bugs, those are bugs. But you notice that you are using -alpha after all.

Was this reported before?

No. Thanks for reporting. Unfortunately Smack’s unit and integration test do not cover (yet) every aspect of the API. This was introduced with the MUC API redesign for 4.2, and is typical for Java that this kind of bug is introduced when a String is replaced by a class. I’d really welcome everyone willing to contribute new tests and bugfixes.

I tried checking the project out and fixing these lines myself, but i can’t get it to build (a lot of gradle errors)

Which version are you using?

Should be fixed with Fix MUCRole and MUCAffiliation equal checks in MultiUserChat · Flowdalic/Smack@ef8fa1f · GitHub