Skip to content

fix(share): propagate closed to firehose sources#6370

Merged
benlesh merged 5 commits intoReactiveX:masterfrom
cartant:cartant/share-firehose
May 6, 2021
Merged

fix(share): propagate closed to firehose sources#6370
benlesh merged 5 commits intoReactiveX:masterfrom
cartant:cartant/share-firehose

Conversation

@cartant
Copy link
Copy Markdown
Collaborator

@cartant cartant commented May 6, 2021

Description:

This PR fixes share so that it wires up the teardown before subscribing to the source - ensuring the assignment to the subscriber's closed property is propagated to the firehose source.

The skipped firehose test has been enabled and the firehose tests that related to now-deprecated operators have been removed.

Related issue (if exists): #5834 (I've closed this because it related to the now-deprecated APIs)

@cartant cartant requested a review from benlesh May 6, 2021 08:10
@cartant cartant added the 7.x Issues and PRs for version 7.x label May 6, 2021
// up _before_ the subscription to the source occurs. This is done so that
// the assignment to the source connection's `closed` property will be seen
// by synchronous firehose sources.
subscriber.add(() => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆

}
});

synchronousObservable.pipe(shareReplay(), take(3)).subscribe(() => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we'd still want this test for refCount: true.

Copy link
Copy Markdown
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. However, I think we may want to add the test back for shareReplay in the refCount: true case.

@benlesh benlesh merged commit 2271a91 into ReactiveX:master May 6, 2021
@cartant cartant deleted the cartant/share-firehose branch May 15, 2021 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.x Issues and PRs for version 7.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants