Errors being trapped by merge operations like switchMaps
See original GitHub issueRxJS version: 5.5.5
Code to reproduce:
EDIT: Ugh, the code I had to reproduce this didn’t reproduce it as expected… but I’ve seen a non-trivial reproduction. cc @IgorMinar
Expected behavior: Error “final error” should be reported in console
Actual behavior: Error is squeltched.
Additional information:
This only happens if the observable in the merge operation is asynchronous. The error thrown by the subscription unwinds the stack back to the switchMap’s subscriber (via parent.notifyError from InnerSubscriber), and it’s swallowed because the switchMap subscriber isStopped
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:12 (7 by maintainers)
Top Results From Across the Web
RXJS v6.4 switchMap operator returns an Observable rather ...
I am running an Angular 8 app, and I am getting an error which seems to be a major bug in RxJS or...
Read more >RxJS: Avoiding switchMap-related Bugs - ncjamieson
If switchMap is replaced with mergeMap , the effect/epic will concurrently handle each dispatched action. That is, pending removals will not be ...
Read more >Controlling multiple HTTP requests with RxJS - esveo
switchMap if you need to wait for the result of a first request to start the second ; combineLatest if you need to...
Read more >RxJs Mapping: switchMap vs mergeMap vs concatMap vs ...
Here is how the mergeMap operator works: each value of the source Observable is still being mapped into an inner Observable, just like...
Read more >Reactor 3 Reference Guide
Then RxJava implemented reactive programming on the JVM. As time went on, a standardization for Java emerged through the Reactive Streams effort ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jayphelps that build didn’t work because it’s not complete (all add/operator/* files are missing), but I was able to diff it and extract this patch that I applied to my current build:
With this patch applied to the JS files by hand, I was able to confirm that the errors now get propagated correctly, so if I extracted the change correctly, then what you did resolves the 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.