onStoppedNotification and onUnhandledError shouldn't be allowed to flip synchronous via provider delegates
benlesh opened this issue · 1 comments
benlesh commented
We currently allow the TestScheduler (or anyone who wants to fiddle with the delegate for timeoutProvider
) to allow config.onUnhandledError
and config.onStoppedNotification
to synchronously dispatch. The problem with that is if either of those throw while synchronous, it will unwind the stack and cause all sorts of crazy stuff. The provider delegates are meant primarily so that TestScheduler can synchronously control what is going on with observable emissions. onUnhandledError
and onStoppedNotification
are firmly outside of that lifecycle and should always be dispatched in their own call stack to prevent issues.
benlesh commented
This is also a prerequisite for getting to where we can cleanly publish @rxjs/observable
.