{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/8337","repository_url":"https://api.github.com/repos/meteor/meteor","labels_url":"https://api.github.com/repos/meteor/meteor/issues/8337/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/8337/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/8337/events","html_url":"https://github.com/meteor/meteor/issues/8337","id":206424187,"number":8337,"title":"[Question] Optimistic UI - How to re-use it ?","user":{"login":"theodorDiaconu","id":1814863,"avatar_url":"https://avatars3.githubusercontent.com/u/1814863?v=3","gravatar_id":"","url":"https://api.github.com/users/theodorDiaconu","html_url":"https://github.com/theodorDiaconu","followers_url":"https://api.github.com/users/theodorDiaconu/followers","following_url":"https://api.github.com/users/theodorDiaconu/following{/other_user}","gists_url":"https://api.github.com/users/theodorDiaconu/gists{/gist_id}","starred_url":"https://api.github.com/users/theodorDiaconu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theodorDiaconu/subscriptions","organizations_url":"https://api.github.com/users/theodorDiaconu/orgs","repos_url":"https://api.github.com/users/theodorDiaconu/repos","events_url":"https://api.github.com/users/theodorDiaconu/events{/privacy}","received_events_url":"https://api.github.com/users/theodorDiaconu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-02-09T07:16:05Z","updated_at":"2017-05-15T15:23:30Z","closed_at":null,"body":"Context\r\n===========\r\n\r\nHello, this is related to the project redis-oplog, https://github.com/cult-of-coders/redis-oplog\r\n\r\nTimeline of an optimistic ui update as client:\r\n1. Send call to a method that does a mutation client-side and server-side (an optimistic ui method)\r\n2. Receive DDP collection mutations from the server\r\n3. Receive \"ok\" for method execution.\r\n\r\nIf 2 isn't executed, or is executed after 3. It will result into a flicker:\r\n1. Changes are made to the collection on client\r\n2. Receive \"ok\" for method execution\r\n3. Changes are reverted, because we did not receive any \"validation\" from the server of the client-side mutations\r\n4. New changes come-in processed by the redis server.\r\n\r\nCurrent solution in redis-oplog, is when we call the method, we synchronously dispatch and diff the changes for all clients in the mutator methods of the collection (update/upsert/insert/remove) and they are performed in sync for all observers running on that meteor instance.\r\n\r\nHowever, this approach is not ok, because it will result in method spikes due to extra processing.\r\n\r\nPossible solution:\r\n- Perform a naive update only on the connection id of the invoker\r\n\r\nMy Question\r\n===========\r\nHow can I harness Meteor's way of doing this ? Without having to re-implement the logic of the possible solution.\r\n\r\nI need someone with deeper understanding of optimistic-ui to give me a helping hand. Thank you!"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/301509277","html_url":"https://github.com/meteor/meteor/issues/8337#issuecomment-301509277","issue_url":"https://api.github.com/repos/meteor/meteor/issues/8337","id":301509277,"user":{"login":"hwillson","id":137740,"avatar_url":"https://avatars2.githubusercontent.com/u/137740?v=3","gravatar_id":"","url":"https://api.github.com/users/hwillson","html_url":"https://github.com/hwillson","followers_url":"https://api.github.com/users/hwillson/followers","following_url":"https://api.github.com/users/hwillson/following{/other_user}","gists_url":"https://api.github.com/users/hwillson/gists{/gist_id}","starred_url":"https://api.github.com/users/hwillson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hwillson/subscriptions","organizations_url":"https://api.github.com/users/hwillson/orgs","repos_url":"https://api.github.com/users/hwillson/repos","events_url":"https://api.github.com/users/hwillson/events{/privacy}","received_events_url":"https://api.github.com/users/hwillson/received_events","type":"User","site_admin":false},"created_at":"2017-05-15T15:23:30Z","updated_at":"2017-05-15T15:23:30Z","body":"Hi @theodorDiaconu - take a look at the DDP server's [`Session`](https://github.com/meteor/meteor/blob/f0dd494c82244df79b544bdbf590ebecc0412189/packages/ddp-server/livedata_server.js#L325) class (not to be confused with the `ReactiveDict` based [`Session`](https://github.com/meteor/meteor/tree/devel/packages/session)). Does that help?\r\n\r\nReading over this issue thread, I'm trying to figure out how to help move this forward from an issue triaging point of view. This thread really is more of a discussion, that doesn't have any clear issues or feature requests that can be extracted out, and worked on. How would you guys like to proceed with this? Is there anything actionable here that should be extracted? I'm just wondering if we should keep the discussion going here, or if this thread would be better suited on the forums."}}
{"actor":{"display_login":"hwillson"}}