Cannot add new events after calling close
furkanKotic opened this issue · comments
furkanKotic commented
I saw this error on Firebase. I am trying to unsubscribe channel.
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Bad state: Cannot add new events after calling close
at _BroadcastStreamController.add(_BroadcastStreamController.java)
at SubscriptionImpl._addUnsubscribe(subscription.dart:244)
at SubscriptionImpl.moveToUnsubscribed(subscription.dart:173)
at IMController.unsubscribe(im_controller.dart:157)
this is my unsubscribe code:
Future<void> unsubscribe(String channel) async {
var a = _imClient.getSubscription(channel);
if (a != null) {
await a.unsubscribe(); //line 157
_imClient.removeSubscription(a);
}
}
Alexander Emelin commented
Hello @furkanKotic - please provide reproducing example in the style of console example we have.
furkanKotic commented
I don't have an example. I can't find how this happened. I think we will not find the problem.