{"action":"created","issue":{"url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/1032","repository_url":"https://api.github.com/repos/mobxjs/mobx-state-tree","labels_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/1032/labels{/name}","comments_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/1032/comments","events_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/1032/events","html_url":"https://github.com/mobxjs/mobx-state-tree/pull/1032","id":366584334,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwMjIyMDc4","number":1032,"title":"[Fixed #750] Flow actions mutations not syncing to Redux DevTools.","user":{"login":"bourquep","id":65096,"node_id":"MDQ6VXNlcjY1MDk2","avatar_url":"https://avatars0.githubusercontent.com/u/65096?v=4","gravatar_id":"","url":"https://api.github.com/users/bourquep","html_url":"https://github.com/bourquep","followers_url":"https://api.github.com/users/bourquep/followers","following_url":"https://api.github.com/users/bourquep/following{/other_user}","gists_url":"https://api.github.com/users/bourquep/gists{/gist_id}","starred_url":"https://api.github.com/users/bourquep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bourquep/subscriptions","organizations_url":"https://api.github.com/users/bourquep/orgs","repos_url":"https://api.github.com/users/bourquep/repos","events_url":"https://api.github.com/users/bourquep/events{/privacy}","received_events_url":"https://api.github.com/users/bourquep/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-04T01:03:30Z","updated_at":"2018-10-05T19:13:58Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/mobxjs/mobx-state-tree/pulls/1032","html_url":"https://github.com/mobxjs/mobx-state-tree/pull/1032","diff_url":"https://github.com/mobxjs/mobx-state-tree/pull/1032.diff","patch_url":"https://github.com/mobxjs/mobx-state-tree/pull/1032.patch"},"body":"By only hooking into the `onAction` notification, the Redux middleware was handling flow (async) actions at their beginning, where the state has not changed yet. So this MR injects another middleware to intercept `flow_return` action types, which is when the async action is done and the new state is available. \r\n\r\nIdeally, we would exclude the regular `action` type for these, but at the time the middleware is invoked with `call.type = \"action\"` there is no way to determine if this is in fact an async action.\r\n\r\nSo, when an async action is invoked, the Redux DevTools will display:\r\n\r\n```\r\nmyAction\r\nmyAction [flow_return]\r\n```\r\n\r\nAnd it's the `[flow_return]` one that will include the new state.\r\n\r\nThere weren't any existing tests for the Redux middleware, and I wouldn't really know how to implement them (looks like it would require mocking `remotedev`).\r\n"},"comment":{"url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/comments/427470911","html_url":"https://github.com/mobxjs/mobx-state-tree/pull/1032#issuecomment-427470911","issue_url":"https://api.github.com/repos/mobxjs/mobx-state-tree/issues/1032","id":427470911,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzQ3MDkxMQ==","user":{"login":"bourquep","id":65096,"node_id":"MDQ6VXNlcjY1MDk2","avatar_url":"https://avatars0.githubusercontent.com/u/65096?v=4","gravatar_id":"","url":"https://api.github.com/users/bourquep","html_url":"https://github.com/bourquep","followers_url":"https://api.github.com/users/bourquep/followers","following_url":"https://api.github.com/users/bourquep/following{/other_user}","gists_url":"https://api.github.com/users/bourquep/gists{/gist_id}","starred_url":"https://api.github.com/users/bourquep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bourquep/subscriptions","organizations_url":"https://api.github.com/users/bourquep/orgs","repos_url":"https://api.github.com/users/bourquep/repos","events_url":"https://api.github.com/users/bourquep/events{/privacy}","received_events_url":"https://api.github.com/users/bourquep/received_events","type":"User","site_admin":false},"created_at":"2018-10-05T19:13:58Z","updated_at":"2018-10-05T19:13:58Z","author_association":"NONE","body":"I have tried various things, but each attempt results in Chrome running out of memory. Not sure if it's an issue with devtools or with mst-middleware, but I don't have time right now to look into it."}}
{"actor":{"display_login":"bourquep"}}