When disconnect is called on MQTTSessionManager in "starting" state (that is, before starting any connection), it gets stuck in "closing" state indefinitely.
Environment
Operating system: iOS
Package Manager: Carthage
MQTTClient version: 0.15.2
MQTT Broker used: AWS IoT (it's rather not broker-specific)
Steps to reproduce
Initialize MQTTSessionManager
Call disconnect(disconnectHandler:)) on it (without calling connect first - the manager is in "starting" state)
Expected behaviour
Manager's state eventually changes to "closed", or it remains in "starting" state.
Short description
When
disconnect
is called onMQTTSessionManager
in "starting" state (that is, before starting any connection), it gets stuck in "closing" state indefinitely.Environment
Steps to reproduce
MQTTSessionManager
disconnect(disconnectHandler:))
on it (without callingconnect
first - the manager is in "starting" state)Expected behaviour
Manager's state eventually changes to "closed", or it remains in "starting" state.
Actual behaviour
Manager changes state to "closing" and never transitions to "closed". Then the next
connect
call will not work - the manager will remain in "closing" state (probably because of this check: https://github.com/novastone-media/MQTT-Client-Framework/blob/33e06af6ae0c5d93f51191fdd0c2d8453c5ddfa9/MQTTClient/MQTTClient/MQTTSessionManager.m#L335).Other information
I think calling
disconnect
in "starting" / "closed" state should be a no-op (do nothing).