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

hotfix(schema) fix propagation of values on updates #3910

Merged
merged 2 commits into from Oct 31, 2018

Conversation

Projects
None yet
2 participants
@hishamhm
Copy link
Member

commented Oct 25, 2018

Fixes some problems with PATCH operations on updates:

  • adjust_field_for_context: the filling of default values was recursing incorrectly when values are nil on "update" contexts: it should not recurse, and in case the table is not nullable, it should just fail on validation later; fixing this prevents clobbering partial updates with default values.
  • merge_values: make sure that invalid fields are merged as well, so that it failed validation in the next step when passing a bogus field on input.

For regression testing, this PR adds more tests for failure cases of PATCH operations on plugins.

hishamhm added some commits Oct 25, 2018

hotfix(schema) fix propagation of values on updates
Fixes some problems with PATCH operations on updates:

* the filling of default values was recursing incorrectly
  when values are nil on "update" contexts: it should not
  recurse, and in case the table is not nullable, it should
  just fail on validation later; fixing this prevents
  clobbering partial updates with defaults.
* make sure that invalid fields are merged as well when
  using `merge_values`, so that it failed validation in
  the next step when passing a bogus field on input.

This adds more tests for failure cases of PATCH operations on plugins.
hotfix(schema) only recurse process_auto_fields on tables
Fixes a crash when a non-record is passed to a record field.

Includes a regression test.
@kikito

kikito approved these changes Oct 31, 2018

@hishamhm hishamhm merged commit 8c719e6 into next Oct 31, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@hishamhm hishamhm deleted the fix/plugin-updates branch Oct 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.