OK, I encountered this issue:
I was offline, somebody send me 100 messages.
I’m go online, I will receive all the offline messages, but it takes some time. For example, when I receive 50 messages, I kill the app or the app crashed, all the rest messages will gone.
Because sending ack answer is faster than UI part(Store in database, show on screen), it’s in different thread. When the UI part receive 50 messages, all the ack answer have been sent out. the rest 50 message are in the memory and waiting for process. But now the app been killed or crashed the messages in memory will miss, am I right?
By right, if I enabled XEP-0198 there is no reason to encounter missing message issue.
The XEP-0198 based on ‘AckAnswer’ and ‘AckRequest’. And in this case, the ack answers have been sent out but the UI part did not finished, will encounter missing message issue.
So I try to override the sendSmAcknowledgement method and send ack answer by myself(after invokePacketCollectorsAndNotifyRecvListeners be called).
Which means after UI work finished, then call sendSmAcknowledgement.
Please correct me if I’m wrong, thank you.