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

Concat behavior change between versions 6.5.4 and 7.5.5. #6978

Open
CaffeinatedCodeMonkey opened this issue May 24, 2022 · 0 comments
Open

Comments

@CaffeinatedCodeMonkey
Copy link

CaffeinatedCodeMonkey commented May 24, 2022

Describe the bug

I recently updated my version RxJS from 6.5.4 to 7.5.5 and started coming across issues in my unit tests. I eventually narrowed it down to something in concat. In 6.5.4, if a root observable was shared between the first and second param of concat, the observable would not complete during the transition. This is not the case in 7.5.5, and I have not found documentation that outlines a breaking change.

Expected behavior

I expected the shared root observable to survive the transition between subscriptions in the concat.

Reproduction code

import { race, of, concat, Subject, interval } from 'rxjs';
import { map, delay, take, share, finalize } from 'rxjs/operators';
const sub = new Subject();
const myRootObservable = sub.pipe(
  finalize(() => console.log('I completed')),
  share()
);
const myFirstObservable = myRootObservable.pipe(map(() => 1));
const mySecondObservable = myRootObservable.pipe(map(() => 2));

concat(myFirstObservable.pipe(take(1)), mySecondObservable).subscribe(
  console.log
);
sub.next();

Reproduction URL

https://stackblitz.com/edit/rxjs-bhfcss?file=index.ts

Version

6.5.4 and 7.5.5

Environment

No response

Additional context

No response

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

No branches or pull requests

1 participant