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

[BUGFIX beta] Correctly handle invalid errors without payload or pointer #3859

Merged
merged 1 commit into from
Oct 15, 2015

Conversation

tchak
Copy link
Member

@tchak tchak commented Oct 15, 2015

Closes #3851, #3852

@@ -644,6 +646,10 @@ InternalModel.prototype = {
}
}

if (isEmpty(Object.keys(errors))) {
this.send('becameInvalid');
}
Copy link
Member

Choose a reason for hiding this comment

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

Why not always send the becameInvalid event?

Copy link
Member Author

Choose a reason for hiding this comment

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

because it will double send it (because of events on errors) and it breaks lots of tests

Copy link
Member

Choose a reason for hiding this comment

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

What happens if this code runs to put the record in the invalid state then an error is added to the errors object?

@bmac
Copy link
Member

bmac commented Oct 15, 2015

@tchak could you amend this commit to start with [BUGFIX beta]

@tchak tchak force-pushed the handle-invlid-errors-without-payload branch 2 times, most recently from 51acce0 to 100390b Compare October 15, 2015 14:46
@tchak tchak changed the title correctly handle invalid errors without payload or pointer [BUGFIX beta] Correctly handle invalid errors without payload or pointer Oct 15, 2015
@tchak tchak force-pushed the handle-invlid-errors-without-payload branch from 100390b to f4e7100 Compare October 15, 2015 14:50
@tchak
Copy link
Member Author

tchak commented Oct 15, 2015

@bmac so after some thought it probably make sens to be able to call becameInavlid multiple times. Fixed it.

@bmac
Copy link
Member

bmac commented Oct 15, 2015

Looks good. 👍

tchak added a commit that referenced this pull request Oct 15, 2015
[BUGFIX beta] Correctly handle invalid errors without payload or pointer
@tchak tchak merged commit f545e98 into emberjs:master Oct 15, 2015
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.

3 participants