-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(Subscriber): creates subscriber throwable by default #2865
Conversation
/cc @benlesh |
|
Generated by 🚫 dangerJS |
0f59314
to
9309bae
Compare
even if this is accepted it'll be probably 5 only and not being cherrypicked into next branch as planned breaking changes. |
I'm not sure about this one... it seems like it will make syncError tracking occur within operators, which I'm pretty sure isn't necessary (which is why the current code avoids it explicitly). Either way, error rethrowing is going away in 6.0 to reach compliance with the proposal, and to prevent some really, really nasty errors like: // imagine we're shipping this off to a few third parties
const source$ = Observable.interval(1000).share();
// third party 1
source$.map(x => x + x).subscribe(x => console.log(x));
// third party 2
source$.filter(x => {
if (x > 3) throw new Error('haha');
return x <= 3;
})
.subscribe(x => console.log(x));
// third party 3
source$.mergeMap(x => Observable.timer(x))
.subscribe(x => console.log(x)) ... what's going to happen above is on the fifth emission, the number There are other reasons too... Like how are you going to In the end, in v6, we will have a notification channel for unhandled errors, and we'll need to remove the rethrowing behavior. |
Yes, reason I mentioned in PR
Most cases it's true, refer issue #2813 for some higher order observable cases with asynchronously scheduled. As I said already above I have feeling this might not appropriate fix, but we do currently have completely swalloing exception and doesn't deliver it into top level observer.
Absolutely, issue should be v5 targeted fix as mentioned |
I'm trying to decide if this solves #3183 or not. |
did #3161 solve the same problem? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
I have gut feeling this might not be appropriate fix, feel free to close.
This PR ensure subscriber created internally have nested parents (i.e CombineLatestSubscriber has Mergemap as parents, etcs) are having proper syncErrorThrown behavior. Previously it bypasses setting syncError* property as well as wrapping it into safesubscriber, allows some of cases errors are not thrown but just swallowed.
Related issue (if exists):