Hi, I’m using Smack 4.1.4 version.
When the stream is resumed and some stanzas have not been sent to the server, they are pushed from the **unacknowledgedStanzas queue **to the packet writer to be resent to the server, but this queue is not clean, so when the packet writer is going to send the stanza it stores the same one in **unacknowledgedStanzas queue **again. From this moment, the stanzas processed by server are not “ack” by client correctly.
The bug can be found in the packet reader, when it receives the resume stanza from server:
…
// Then re-send what is left in the unacknowledged queue
List stanzasToResend = new LinkedList();
stanzasToResend.addAll(unacknowledgedStanzas);
for (Stanza stanza : stanzasToResend) {
packetWriter.sendStreamElement(stanza);
}
…
I think we should clear the **unacknowledgedStanzas **queue before to resend the stanzas, something like this:
…
// Then re-send what is left in the unacknowledged queue
List stanzasToResend = new LinkedList();
unacknowledgedStanzas.drainTo(stanzasToResend);
unacknowledgedStanzas.addAllfor (Stanza stanza : stanzasToResend) {
packetWriter.sendStreamElement(stanza);
}
…
Regards.