xmpp: Reset pending ack counter when resetting state
This commit is contained in:
parent
0d135c043e
commit
24504aecda
@ -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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user