Send messages to groups after a reconnect not working

Good morning,
I have a problem wiht groups, I’m trying to make groups “re-join” work, without success.

What I do, is genral lines: Login --> launch joinGroups, and attach listeners --> jump to main activity. If app don’t loose connection, it works OK, but when it loose connectivity, then joing the group is not working. I try to send a message to group, and it return

Hola

I search about, it and I saw this problem was solven in Smack 4.2.X, but I still can make it work.

Some considerations: Rooms are not created from android client, are always created by server, or other client like iOS. and are supossed to be created without password., and general reconnection works OK, because is still possible to chat 1v1 .

Here is how I connect to room:

public void createGroupChat(EntityBareJid gJid){

MultiUserChat chatRoom = this.multiUserChatManager.getMultiUserChat(gJid);

try {

chatRoom.addMessageListener(new MessageListener() {

@Override

public void processMessage(Message message) {

connectResponse.newMessageReceived(new ChatMessage(message));

}

});

leaveGroupChat(gJid);

chatRoom.join(this.connection.getUser().getResourcepart());

} catch (XMPPException.XMPPErrorException | SmackException e) {

Logger.e(“ROOM:” + gJid + “\n” + e.getMessage());

e.printStackTrace();

} catch (InterruptedException e) {

e.printStackTrace();

}

}

I have forget somtehing?

I can’t find the error code 406 in XEP-0045: Multi-User Chat nor in XEP-0306: Extensible Status Conditions for Multi-User Chat . Ask your server why it sends this code.

I found this errors : XEP-0045: Multi-User Chat

Table 9: Error Conditions for Entering a Room

Condition
Purpose

Inform user that a password is required

Inform user that he or she is banned from the room

Inform user that the room does not exist

Inform user that room creation is restricted

Inform user that the reserved roomnick must be used

Inform user that he or she is not on the member list

Inform user that his or her desired room nickname is in use or registered by another user

Inform user that the maximum number of users has been reached

Thats the the sended:

G

And here the received:

G

As I can see I get “not-acceptable” , that means, the nickname is used. But , is supossed (or thats what I understant), is when you do a room.join(NICK), the connections handles it, and reconnect again, but this is not my case.

Why do you compare the error conditions for entering a room with the error condition when sending a message to the room?

I think you possible did not correctly join the room, and that’s why the MUC service returns no-acceptable (with error code 406, whatever that means) when sending a message to it. But I can’t tell more without more data.

I am facing the same issue when reconnecting after internet connectivity. getting 406 error not acceptable.
Using smack 4.2.0
I have checked muc.isJoined() but it returns true.

I think you are mixing MUC status codes with Legacy XMPP error codes:

XEP-0086: Error Condition Mappings

406 is simply “not-accetable” stanza error. You could also ignore the code, because they have been removed in RFC 6120.

“not-accetable” is returned, when sending a message to a room without being occupant in that room. Seems like you didn’t join?

I have the same issue. Anyone solved this?
When i join group i can send message with no problem. So you cannot say user is not joined.

It is only when i turn wifi off and then on , when connection resumes i get

error code="406" type="modify"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"