xmpp: Reset pending ack counter when resetting state

This commit is contained in:
PapaTutuWawa 2022-08-07 12:13:47 +02:00
parent 0d135c043e
commit 24504aecda

View File

@ -90,13 +90,17 @@ class StreamManagementManager extends XmppManagerBase {
/// a new session. Primarily useful for clearing the state after disconnecting /// a new session. Primarily useful for clearing the state after disconnecting
Future<void> resetState() async { Future<void> resetState() async {
await _stateLock.synchronized(() async { await _stateLock.synchronized(() async {
setState(_state.copyWith( setState(_state.copyWith(
c2s: 0, c2s: 0,
s2c: 0, s2c: 0,
streamResumptionLocation: null, streamResumptionLocation: null,
streamResumptionId: null, streamResumptionId: null,
),); ),);
await commitState(); await commitState();
});
await _ackLock.synchronized(() async {
_pendingAcks = 0;
}); });
} }