Skip to content
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

Merged
merged 7 commits into from
Sep 29, 2020

Conversation

cartant
Copy link
Collaborator

@cartant cartant commented Sep 24, 2020

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

@cartant cartant changed the title Issue 5658 WIP: enable remaining synchronous firehose tests Sep 24, 2020
// 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));
Copy link
Collaborator Author

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.

Comment on lines +705 to +720
// 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.
Copy link
Collaborator Author

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'.

Copy link
Collaborator Author

@cartant cartant Sep 24, 2020

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).

@cartant cartant changed the title WIP: enable remaining synchronous firehose tests test: enable remaining synchronous firehose tests Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants