shareReplay is the problem. There is some debate about its current implementation — which was changed in version
Essentially, the current implementation of
shareReplay will never unsubscribe from its source observable. When used, it relies upon the source observable either completing or erroring.
So, yes, you are correct in that placing
shareReplay is necessary to effect unsubscription from the source.
Perhaps I should add another rule to
rxjs-tslint-rules that warns about
shareReplay being used? Or should make the
takeUntil rule aware of the