Skip to content

fix(zone.js): zone.js patches rxjs should check null for unsubscribe#35990

Closed
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:zone-rxjs-patch-null-check
Closed

fix(zone.js): zone.js patches rxjs should check null for unsubscribe#35990
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:zone-rxjs-patch-null-check

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Contributor

Close #31687, #31684

Zone.js patches rxjs _subscribe and _unsubscribe methods, but zone.js doesn't do null check,
so in some operator such as retryWhen, the _unsubscribe will be set to null, and will cause
zone patched version throw error.

In this PR, if _subscribe and _unsubscribe is null, will not do the patch.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

@JiaLiPassion JiaLiPassion added area: zones Issues related to zone.js target: patch This PR is targeted for the next patch release labels Mar 10, 2020
@JiaLiPassion JiaLiPassion requested a review from mhevery March 10, 2020 12:43
@ngbot ngbot Bot modified the milestone: needsTriage Mar 10, 2020
Comment thread packages/zone.js/test/rxjs/rxjs.Observable.retry.spec.ts Outdated
Comment thread packages/zone.js/lib/rxjs/rxjs.ts Outdated
@JiaLiPassion JiaLiPassion force-pushed the zone-rxjs-patch-null-check branch from 3acdd4e to d505a69 Compare March 10, 2020 19:29
@JiaLiPassion JiaLiPassion requested a review from mhevery March 10, 2020 19:29
@JiaLiPassion JiaLiPassion force-pushed the zone-rxjs-patch-null-check branch 3 times, most recently from 746c068 to b4d65b6 Compare March 11, 2020 00:15
Copy link
Copy Markdown
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

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

I am really sorry but I am going to ask you to go back to previous code, as I miss-understood the test. Really sorry about that.

LGTM and leaving cleanup.
Remove cleanup after fixed.

Comment thread packages/zone.js/test/rxjs/rxjs.Observable.retry.spec.ts Outdated
Comment thread packages/zone.js/test/rxjs/rxjs.Observable.retry.spec.ts Outdated
@mhevery mhevery added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: merge The PR is ready for merge by the caretaker labels Mar 11, 2020
Close angular#31687, angular#31684

Zone.js patches rxjs internal `_subscribe` and `_unsubscribe` methods, but zone.js doesn't do null check, so in some operator such as `retryWhen`, the `_unsubscribe` will be set to null, and will cause
zone patched version throw error.

In this PR, if `_subscribe` and `_unsubscribe` is null, will not do the patch.
@JiaLiPassion JiaLiPassion force-pushed the zone-rxjs-patch-null-check branch from b4d65b6 to e0e7859 Compare March 11, 2020 23:52
@JiaLiPassion JiaLiPassion removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Mar 11, 2020
@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Mar 12, 2020
@AndrewKushnir AndrewKushnir removed the action: presubmit The PR is in need of a google3 presubmit label Mar 16, 2020
@AndrewKushnir
Copy link
Copy Markdown
Contributor

FYI, changes in this PR were tested against g3 as a part of #36043, using Global TAP run, which was successful. Thank you.

AndrewKushnir pushed a commit that referenced this pull request Mar 16, 2020
…35990)

Close #31687, #31684

Zone.js patches rxjs internal `_subscribe` and `_unsubscribe` methods, but zone.js doesn't do null check, so in some operator such as `retryWhen`, the `_unsubscribe` will be set to null, and will cause
zone patched version throw error.

In this PR, if `_subscribe` and `_unsubscribe` is null, will not do the patch.

PR Close #35990
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: zones Issues related to zone.js cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patch-rxjs: _unsubscribe function can be null

4 participants