-
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
test: enable remaining synchronous firehose tests #5749
Conversation
src/internal/operators/throttle.ts
Outdated
// If a synchronous duration selector is specified - weird, but legal - | ||
// an already-closed subscription will be assigned to throttled, so the | ||
// subscription's closed property needs to be checked, too. | ||
(!throttled || throttled.closed) && (leading ? send() : throttle(value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only significant change/fix in the PR.
// AFAICT, it's not possible for multicast observables to support ASAP | ||
// unsubscription from synchronous firehose sources. The problem is that the | ||
// chaining of the closed 'signal' is broken by the subject. For example, | ||
// here: | ||
// | ||
// https://github.com/ReactiveX/rxjs/blob/2d5e4d5bd7b684a912485e1c1583ba3d41c8308e/src/internal/operators/multicast.ts#L53 | ||
// | ||
// The subject is passed to subscribe. However, in the subscribe | ||
// implementation a SafeSubcriber is created with the subject as the | ||
// observer: | ||
// | ||
// https://github.com/ReactiveX/rxjs/blob/2d5e4d5bd7b684a912485e1c1583ba3d41c8308e/src/internal/Observable.ts#L210 | ||
// | ||
// That breaks the chaining of closed - i.e. even if the unsubscribe is | ||
// called on the subject, closing it, the SafeSubscriber's closed property | ||
// won't reflect that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, multicast
-based operators are not going to pass the synchronous firehose test with the current implementation of the closed
'signal'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this could be fixed by bringing back the SubjectSubscriber
.
Just to be clear, though, I think we should merge this PR as-is and address this multicast-firehose business in another PR (if at all).
Description:
This PR enables the remaining synchronous firehose tests and fixes operators to ensure they pass. Several operators have tests that now pass due to changes made in other refactoring PRs.
Related issue (if exists): #5658