-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUGFIX beta] Correctly handle invalid errors without payload or pointer #3859
Conversation
@@ -644,6 +646,10 @@ InternalModel.prototype = { | |||
} | |||
} | |||
|
|||
if (isEmpty(Object.keys(errors))) { | |||
this.send('becameInvalid'); | |||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
@tchak could you amend this commit to start with |
51acce0
to
100390b
Compare
100390b
to
f4e7100
Compare
@bmac so after some thought it probably make sens to be able to call |
Looks good. 👍 |
[BUGFIX beta] Correctly handle invalid errors without payload or pointer
Closes #3851, #3852