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
Future<void> resetState() async {
await _stateLock.synchronized(() async {
setState(_state.copyWith(
c2s: 0,
s2c: 0,
streamResumptionLocation: null,
streamResumptionId: null,
),);
await commitState();
setState(_state.copyWith(
c2s: 0,
s2c: 0,
streamResumptionLocation: null,
streamResumptionId: null,
),);
await commitState();
});
await _ackLock.synchronized(() async {
_pendingAcks = 0;
});
}