Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad state: Cannot add new events after calling close #45

Closed
brizaldi opened this issue May 5, 2020 · 3 comments
Closed

Bad state: Cannot add new events after calling close #45

brizaldi opened this issue May 5, 2020 · 3 comments
Assignees
Labels
alpha bug Something isn't working

Comments

@brizaldi
Copy link

brizaldi commented May 5, 2020

i got this error message when using the alpha version

E/flutter (31659): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: Bad state: Cannot add new events after calling close
E/flutter (31659): #0      _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:251:24)
E/flutter (31659): #1      Subject._add (package:rxdart/src/subjects/subject.dart:141:17)
E/flutter (31659): #2      Subject.add (package:rxdart/src/subjects/subject.dart:135:5)
E/flutter (31659): #3      ChannelsBlocState.queryChannels.<anonymous closure> (package:stream_chat_flutter/src/channels_bloc.dart:90:31)
E/flutter (31659): #4      _rootRunUnary (dart:async/zone.dart:1192:38)
E/flutter (31659): #5      _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (31659): #6      _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
E/flutter (31659): #7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
E/flutter (31659): #8      _DelayedData.perform (dart:async/stream_impl.dart:594:14)
E/flutter (31659): #9      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:710:11)
E/flutter (31659): #10     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:670:7)
E/flutter (31659): #11     _rootRun (dart:async/zone.dart:1180:38)
E/flutter (31659): #12     _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (31659): #13     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter (31659): #14     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
E/flutter (31659): #15     _rootRun (dart:async/zone.dart:1184:13)
E/flutter (31659): #16     _CustomZone.run (dart:async/zone.dart:1077:19)
E/flutter (31659): #17     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
E/flutter (31659): #18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
E/flutter (31659): #19     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
E/flutter (31659): #20     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)

the chat functionality still working fine though

@imtoori imtoori added alpha bug Something isn't working labels May 5, 2020
@imtoori imtoori self-assigned this May 5, 2020
@apgapg
Copy link
Contributor

apgapg commented Dec 10, 2020

To better handle this I have created certain extensions on BehaviorSubject:
https://gist.github.com/apgapg/a520872c263b70bcfec52da0d7c221ec

@imtoori
Copy link
Contributor

imtoori commented Jan 26, 2021

This should not happen anymore
Feel free to reopen it if you're still facing it

@imtoori imtoori closed this as completed Jan 26, 2021
@rohan20
Copy link

rohan20 commented Feb 14, 2021

@imtoori This still occurs on ^0.2.21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants