-
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
first() produce a lot more than 1 data in some recursive situation. #2098
Comments
I think this is similar case to #1759 (comment) to try synchronous reentrant causes those behavior. As your last snippet does, if you explicitly make it asynchronous to trap out from synchronous boundary it'll work, as similar /cc @trxcllnt to confirm in case if I understood this incorrectly and this is unexpected behavior. |
Yes we should likely guard after the first emission, similar in spirit to #1967 |
I'll have a look |
adds guard after first emitted value to prevent reentrant behavior fixes #2098
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. |
It is pretty hard to describe in text. The code below might be more understandable.
I have a
Subject
that is connected withfirst()
and subscribed with a observer that will fire a data synchronously to the sameSubject
withnext()
. It turns out that the observer receives a lot of data even though it is chained withfirst()
.I found this bug in more personal complicated code, but below is a simplified repro one. Also, I'm not sure if this is expected behavior or not.
RxJS version:
5.0.0-beta.12
Code to reproduce:
Expected behavior:
Data should be received once.
Actual behavior:
Large amount of data fired to observer. Sometimes, the Error
Maximum call stack size exceeded
shows up.Additional information:
When data is pushed asynchronously, the test will pass. Here is the asynchronous test in Jasmine:
In this case, the test passes.
The text was updated successfully, but these errors were encountered: