Open bmatasar opened 9 months ago
Should this also automatically call right before disconnect?
This is a good question. In XEP-0198 they don't mention such a thing. They have 2 scenarios, one where an ack is sent after every message, the other with an ack sent every 5th message. In my use case I get seldom a couple of packets and the second scenario might leave some in the air, so I preferred to send an ack after processing a bulk.
Sending an ack before going offline might seem a good idea. Adding a config property to send automatically an ack after every n-th message would be another useful thing.
Please let me know if I can help with any of the 2.
It's right in your quote in the OP here:
It is RECOMMENDED that initiating entities (usually clients) send an element right before they gracefully close the stream, in order to inform the peer about received stanzas
otherwise I would only send when asked by the other side, as is done now.
I added the sending of the ack before going offline. I hope that is enough.
In the specs it says:
I added a simple function to do that. Usage:
client.streamManagement.sendAck()