Skip to content

Commit

Permalink
test: add comment re: closed chain breakage
Browse files Browse the repository at this point in the history
Closes #5658.
  • Loading branch information
cartant committed Sep 25, 2020
1 parent d5f15e1 commit 2a0aa7e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/operators/multicast-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,22 @@ describe('multicast operator', () => {
});

// TODO: fix firehose unsubscription
// 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.
it.skip('should stop listening to a synchronous observable when unsubscribed', () => {
const sideEffects: number[] = [];
const synchronousObservable = new Observable<number>(subscriber => {
Expand Down

0 comments on commit 2a0aa7e

Please sign in to comment.