shamblett/mqtt_client

Bad state: Cannot add new events after calling close

Closed this issue · 2 comments

I believe this error occurs when the lib tries to send an ack message after being disconnected.

Stack trace

_BroadcastStreamController.add (dart:async)
EventBus.fire (event_bus.dart:61)
PublishingManager.handlePublish (mqtt_client_publishing_manager.dart:165)
MqttConnectionHandlerBase.messageAvailable (mqtt_client_mqtt_connection_handler_base.dart:225)

Would be possible to add a validation before send a ack message?

Yes OK, I'll look at this

Updated the client to log when this condition occurs rather than failing as it does now.

Package re published at version 10.2.0