{"action":"created","issue":{"url":"https://api.github.com/repos/staltz/xstream/issues/239","repository_url":"https://api.github.com/repos/staltz/xstream","labels_url":"https://api.github.com/repos/staltz/xstream/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/staltz/xstream/issues/239/comments","events_url":"https://api.github.com/repos/staltz/xstream/issues/239/events","html_url":"https://github.com/staltz/xstream/issues/239","id":296220925,"number":239,"title":"Out of order events with immitate","user":{"login":"lolgesten","id":30282827,"avatar_url":"https://avatars0.githubusercontent.com/u/30282827?v=4","gravatar_id":"","url":"https://api.github.com/users/lolgesten","html_url":"https://github.com/lolgesten","followers_url":"https://api.github.com/users/lolgesten/followers","following_url":"https://api.github.com/users/lolgesten/following{/other_user}","gists_url":"https://api.github.com/users/lolgesten/gists{/gist_id}","starred_url":"https://api.github.com/users/lolgesten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolgesten/subscriptions","organizations_url":"https://api.github.com/users/lolgesten/orgs","repos_url":"https://api.github.com/users/lolgesten/repos","events_url":"https://api.github.com/users/lolgesten/events{/privacy}","received_events_url":"https://api.github.com/users/lolgesten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-11T20:10:20Z","updated_at":"2018-02-16T22:01:07Z","closed_at":null,"author_association":"NONE","body":"I'm observing out of order events. First some pseudo to explain what I got.\r\n\r\n```js\r\nfunction main(sources) {\r\n  // updates to merged app state on the form `{key: value}`\r\n  const update$ = xs.create();\r\n\r\n  // folded app state\r\n  const state$ = update$\r\n    .fold((state, update) => ({...state, ...update}), {})\r\n    .debug('state');\r\n\r\n  // various inputs that produces updates$. \r\n  // one also evaluates state$ to updates. cyclic, but should be ok.\r\n  ...\r\n\r\n  // proxy that follows stream$, but sees a different order!!!\r\n  const proxy$ = xs.from(stream$).debug('proxy');\r\n\r\n  const realUpdate$ = xs.merge(\r\n    ...\r\n  ).debug('update');\r\n\r\n  updates$.imitate(realUpdate$); // cyclic!\r\n\r\n  return { ... };\r\n}\r\n```\r\n\r\nMy real scenario is more complicated with lots of state evaluation, so it's entirely possible that the problem is introduced somewhere else.\r\n\r\nI observe the correct state order on `state`, but the `proxy` sees another.\r\n\r\n<img width=\"636\" alt=\"screen shot 2018-02-11 at 20 50 49\" src=\"https://user-images.githubusercontent.com/30282827/36077762-0aa38d16-0f6f-11e8-8197-402b2615fdb0.png\">\r\n\r\n* 4th row, update with `config` merged into state.\r\n* 5th row new state with merged in `config`\r\n* 6th row evaluating the `state$` we spot state `IDLE` and `config`, produce update `INITED`\r\n* 7th row new state merged in new `appState`\r\n* 8th - 9th row. `proxy` sees the events out of order. :("},"comment":{"url":"https://api.github.com/repos/staltz/xstream/issues/comments/366371000","html_url":"https://github.com/staltz/xstream/issues/239#issuecomment-366371000","issue_url":"https://api.github.com/repos/staltz/xstream/issues/239","id":366371000,"user":{"login":"lolgesten","id":30282827,"avatar_url":"https://avatars0.githubusercontent.com/u/30282827?v=4","gravatar_id":"","url":"https://api.github.com/users/lolgesten","html_url":"https://github.com/lolgesten","followers_url":"https://api.github.com/users/lolgesten/followers","following_url":"https://api.github.com/users/lolgesten/following{/other_user}","gists_url":"https://api.github.com/users/lolgesten/gists{/gist_id}","starred_url":"https://api.github.com/users/lolgesten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lolgesten/subscriptions","organizations_url":"https://api.github.com/users/lolgesten/orgs","repos_url":"https://api.github.com/users/lolgesten/repos","events_url":"https://api.github.com/users/lolgesten/events{/privacy}","received_events_url":"https://api.github.com/users/lolgesten/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T22:01:07Z","updated_at":"2018-02-16T22:01:07Z","author_association":"NONE","body":"Wrote it as a test case too. https://gist.github.com/lolgesten/318dd558786d6da3d56338c123bdf3c7"}}
{"actor":{"display_login":"lolgesten"}}