Skip to content

fix(common): AsyncPipe should not throw when given observable of NaN#15723

Closed
DzmitryShylovich wants to merge 1 commit intoangular:masterfrom
DzmitryShylovich:gh/15721
Closed

fix(common): AsyncPipe should not throw when given observable of NaN#15723
DzmitryShylovich wants to merge 1 commit intoangular:masterfrom
DzmitryShylovich:gh/15721

Conversation

@DzmitryShylovich
Copy link
Copy Markdown
Contributor

@DzmitryShylovich DzmitryShylovich commented Apr 3, 2017

Closes #15721

}

if (this._latestValue === this._latestReturnedValue) {
if (looseIdentical(this._latestValue, this._latestReturnedValue)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NaN !== NaN so AsyncPipe will return WrappedValue instead of NaN which results in expression has changed error.

@chuckjaz chuckjaz added the area: common Issues related to APIs in the @angular/common package label May 23, 2017
@vicb vicb added the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 7, 2017
@splincode
Copy link
Copy Markdown
Contributor

@DzmitryShylovich what is the status of your pull request?

@trotyl
Copy link
Copy Markdown
Contributor

trotyl commented Mar 16, 2018

This will not fix the issue, the test case passed only because NaN is the first synchronously emitted value, try change the test case to:

it('should return NaN when given NaN and the latest returned value is NaN', () => {
    const subject = new BehaviorSubject<any>(null);
    pipe.transform(subject);
    subject.next(NaN);
    expect(pipe.transform(subject)).toBeNaN();
    expect(pipe.transform(subject)).toBeNaN();
});

And it will fail.

@ericmartinezr
Copy link
Copy Markdown
Contributor

You guys could retake this PR since Dzmitry was banned long ago.

@trotyl
Copy link
Copy Markdown
Contributor

trotyl commented Mar 16, 2018

@ericmartinezr Just linked my PR here.

@splincode
Copy link
Copy Markdown
Contributor

@ericmartinezr Dzmitry is banned long ago, why? I do not know the history, what happened?

@trotyl
Copy link
Copy Markdown
Contributor

trotyl commented Aug 8, 2018

@splincode Just a quick search is enough.

@channel: we've banned @DzmitryShylovich permanently for repeated violations of our Code of Conduct. This means on both gitter and angular's github presence.

reminder: we are 100% not screwing around about our Code of Conduct: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md - Please read it, abide by it, and remember that we are trying to keep this as an inclusive community, for everyone.

And you can then check any history message before that date.

@splincode
Copy link
Copy Markdown
Contributor

@trotyl Do you mean that they just blocked it? But for what? So you need to close all its PR?

@trotyl
Copy link
Copy Markdown
Contributor

trotyl commented Aug 8, 2018

So you need to close all its PR?

It's Angular team's job, nothing to do with me...

@splincode
Copy link
Copy Markdown
Contributor

splincode commented Aug 8, 2018

@robwormald Could you close the PR's? Because the PR data will no longer be supported by anyone.

About 10 open requests:
https://github.com/angular/angular/pulls/DzmitryShylovich%20

we've banned @DzmitryShylovich permanently for repeated violations of our Code of Conduct. This means on both gitter and angular's github presence.

reminder: we are 100% not screwing around about our Code of Conduct: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md - Please read it, abide by it, and remember that we are trying to keep this as an inclusive community, for everyone.

@IgorMinar
Copy link
Copy Markdown
Contributor

closing in favor of #22305

@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 Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: common Issues related to APIs in the @angular/common package cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AsyncPipe breaks change detection with NaN values

8 participants