When a record is made invalid by the adapter the errors object is set on the model, with the model attributes that are in error. Once the attributes in error are corrected, they are removed from the errors object.
However this is not the case for attributes that represent a relationship. Once these attributes are set in the error object, updating them will not remove them.
I provided an example with this ticket (#764) but fear that my explanation of the issue was not clear.
My proposed solution is to alter the invalid state, moving the error clearing from didSetProperty to becomeDirty, which is called by both relationship and attribute changes and thereby clearing attributes from the error object when a change occurs.
@everwakeful , I make another proposal to hanle invalid states with embedded records, could you look at #682 and let me know what you think. I'm not sure what will be the preferable solution.
@everwakeful , After looking further into your solution I understand that the PR request #682, does not answer to the same problem even if they are related.
I really like the solution you have for errors on relationship that when there is errors on a relationship field, they will be cleared when we modify the relationship.
Remove errors for relationship properties on record in invalid state …
…when properties are updated
@everwakeful This doesn't merge cleanly and also doesn't include tests. I'm going to close it for now leaving #764 open. If you want to pursue more work on it, please let us know.