{"action":"created","issue":{"url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/926","repository_url":"https://api.github.com/repos/davidkpiano/react-redux-form","labels_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/926/labels{/name}","comments_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/926/comments","events_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/926/events","html_url":"https://github.com/davidkpiano/react-redux-form/issues/926","id":254147851,"number":926,"title":"Model validation incorrect when using custom action to hydrate custom form reducer","user":{"login":"andrewhl","id":1120082,"avatar_url":"https://avatars2.githubusercontent.com/u/1120082?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewhl","html_url":"https://github.com/andrewhl","followers_url":"https://api.github.com/users/andrewhl/followers","following_url":"https://api.github.com/users/andrewhl/following{/other_user}","gists_url":"https://api.github.com/users/andrewhl/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewhl/subscriptions","organizations_url":"https://api.github.com/users/andrewhl/orgs","repos_url":"https://api.github.com/users/andrewhl/repos","events_url":"https://api.github.com/users/andrewhl/events{/privacy}","received_events_url":"https://api.github.com/users/andrewhl/received_events","type":"User","site_admin":false},"labels":[{"id":320548251,"url":"https://api.github.com/repos/davidkpiano/react-redux-form/labels/can't%20reproduce","name":"can't reproduce","color":"bfe5bf","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-30T21:55:57Z","updated_at":"2017-09-03T13:41:51Z","closed_at":"2017-09-03T12:30:23Z","author_association":"CONTRIBUTOR","body":"### The Problem\r\nWe use a custom `LOAD` action to hydrate our custom form reducer (which is is connected via `combineForms`). However, when we fire this action, the model validation is set to false even though `LOAD` provides values to the reducer. The validation rules are simple: `isRequired` and has length > 0. \r\n\r\nNo `rrf/CHANGE` action happens on `LOAD`. We have found that when we fire `dispatch(actions.load('deep.editRecord', record))`, the form is hydrated appropriately, and the `rrf/CHANGE` action is fired, updating the model validation correctly. \r\n\r\nWe would expect that, by virtue of the fact that `combineForms` wraps our reducer in `modeled`, that all actions passed to the reducer will trigger the model validation and `rrf/CHANGE`. Is this not correct?\r\n\r\nHere is our code. We have our reducer connected to redux as follows:\r\n\r\n**Root reducer**\r\n```javascript\r\n    deep: combineForms(\r\n        {\r\n            editRecord: recordFormReducer \r\n        },\r\n        'deep',\r\n    ),\r\n```\r\n\r\n**recordFormReducer.js**\r\n```javascript\r\nexport const initialState = {\r\n    name: '',\r\n    description: '',\r\n    first_name: '',\r\n    last_name: '',\r\n};\r\n\r\nexport default function reducer(state = initialState, action) {\r\n    switch (action.type) {\r\n    case LOAD: {\r\n        const data = action.payload.record;\r\n        const record = {\r\n            name: data.relationship,\r\n            description: data.gender,\r\n            first_name: data.first_name,\r\n            last_name: data.last_name,\r\n        };\r\n\r\n        return {\r\n            ...state,\r\n            ...record,\r\n        };\r\n    }\r\n    default:\r\n        return state;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/comments/326805747","html_url":"https://github.com/davidkpiano/react-redux-form/issues/926#issuecomment-326805747","issue_url":"https://api.github.com/repos/davidkpiano/react-redux-form/issues/926","id":326805747,"user":{"login":"andrewhl","id":1120082,"avatar_url":"https://avatars2.githubusercontent.com/u/1120082?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewhl","html_url":"https://github.com/andrewhl","followers_url":"https://api.github.com/users/andrewhl/followers","following_url":"https://api.github.com/users/andrewhl/following{/other_user}","gists_url":"https://api.github.com/users/andrewhl/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewhl/subscriptions","organizations_url":"https://api.github.com/users/andrewhl/orgs","repos_url":"https://api.github.com/users/andrewhl/repos","events_url":"https://api.github.com/users/andrewhl/events{/privacy}","received_events_url":"https://api.github.com/users/andrewhl/received_events","type":"User","site_admin":false},"created_at":"2017-09-03T13:41:51Z","updated_at":"2017-09-03T13:41:51Z","author_association":"CONTRIBUTOR","body":"@davidkpiano Thanks for the response. Sorry, I didn't have time to post a codepen, but I think you answered our question."}}
{"actor":{"display_login":"andrewhl"}}