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

refactor: unsubscribe on destroy #2112

Merged
merged 4 commits into from
Dec 5, 2019

Conversation

drumonii
Copy link
Contributor

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

    this.destroy$.next();
    this.destroy$.complete();

Resolves #1059

Enable the 'rxjs-no-unsafe-takeuntil' rule with severity of error so that the takeUntil operator remains last in order to protect against potential subscription leaks.
Previously, subscription management was done with takeWhile operator. However that was improperly unsubscribing causing a potential leak of the subscription.
@drumonii drumonii force-pushed the rxjs-subscription-management-refactor branch from 9c88112 to 14e37e6 Compare December 2, 2019 03:02
@codecov
Copy link

codecov bot commented Dec 2, 2019

Codecov Report

Merging #2112 into master will increase coverage by 0.12%.
The diff coverage is 82.52%.

@@            Coverage Diff            @@
##           master   #2112      +/-   ##
=========================================
+ Coverage   84.58%   84.7%   +0.12%     
=========================================
  Files         235     235              
  Lines        8061    8042      -19     
  Branches      710     710              
=========================================
- Hits         6818    6812       -6     
+ Misses       1023    1010      -13     
  Partials      220     220
Impacted Files Coverage Δ
...rk/theme/components/cdk/overlay/overlay-trigger.ts 96.59% <ø> (ø) ⬆️
.../framework/theme/components/menu/menu.component.ts 77.86% <100%> (+1.06%) ⬆️
.../components/cdk/overlay/dynamic/dynamic-overlay.ts 99.11% <100%> (-0.01%) ⬇️
.../theme/components/tree-grid/tree-grid.component.ts 75.92% <100%> (+0.92%) ⬆️
...rk/theme/components/radio/radio-group.component.ts 87.23% <100%> (+0.77%) ⬆️
...k/theme/components/list/infinite-list.directive.ts 91.66% <100%> (+1.5%) ⬆️
...mework/theme/components/layout/layout.component.ts 74.48% <100%> (-0.52%) ⬇️
.../theme/components/select/option-group.component.ts 96.66% <100%> (+0.11%) ⬆️
.../components/context-menu/context-menu.directive.ts 92.15% <100%> (+1.96%) ⬆️
...mework/theme/components/select/select.component.ts 91% <100%> (+0.29%) ⬆️
... and 12 more

@yggg yggg self-requested a review December 4, 2019 13:58
Copy link
Contributor

@yggg yggg left a comment

Choose a reason for hiding this comment

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

Thanks a lot @drumonii 🥇

@yggg yggg changed the title Rxjs subscription management refactor refactor: unsubscribe on destroy Dec 5, 2019
@yggg yggg merged commit 0cab4fc into akveo:master Dec 5, 2019
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.

Rxjs subscriptions management refactoring
2 participants