{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/draft-js/issues/582","repository_url":"https://api.github.com/repos/facebook/draft-js","labels_url":"https://api.github.com/repos/facebook/draft-js/issues/582/labels{/name}","comments_url":"https://api.github.com/repos/facebook/draft-js/issues/582/comments","events_url":"https://api.github.com/repos/facebook/draft-js/issues/582/events","html_url":"https://github.com/facebook/draft-js/pull/582","id":169728863,"number":582,"title":"Prefer rolling index over random key generation. Prefix editor key with","user":{"login":"khankuan","id":1406170,"avatar_url":"https://avatars.githubusercontent.com/u/1406170?v=3","gravatar_id":"","url":"https://api.github.com/users/khankuan","html_url":"https://github.com/khankuan","followers_url":"https://api.github.com/users/khankuan/followers","following_url":"https://api.github.com/users/khankuan/following{/other_user}","gists_url":"https://api.github.com/users/khankuan/gists{/gist_id}","starred_url":"https://api.github.com/users/khankuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khankuan/subscriptions","organizations_url":"https://api.github.com/users/khankuan/orgs","repos_url":"https://api.github.com/users/khankuan/repos","events_url":"https://api.github.com/users/khankuan/events{/privacy}","received_events_url":"https://api.github.com/users/khankuan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/draft-js/labels/CLA%20Signed","name":"CLA Signed","color":"009900"},{"url":"https://api.github.com/repos/facebook/draft-js/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-06T04:30:57Z","updated_at":"2016-09-23T19:16:29Z","closed_at":"2016-09-23T19:16:29Z","pull_request":{"url":"https://api.github.com/repos/facebook/draft-js/pulls/582","html_url":"https://github.com/facebook/draft-js/pull/582","diff_url":"https://github.com/facebook/draft-js/pull/582.diff","patch_url":"https://github.com/facebook/draft-js/pull/582.patch"},"body":"\r\n**Summary**\r\n\r\nRef: https://github.com/facebook/draft-js/issues/385\r\n\r\nThe current key generation method prohibits server-side rendering to have the same checksum when the editor is re-rendered on client side. The solution here is to keep editorKey in editorState so that developers have some control to retain the same editor key by sending the serialized editorState to client side.\r\n\r\nThere is also a performance concern on the current method to generate random keys. The method allows up to 2^24 keys in the seenKeys map. During generation, the method retries if a key previously used is generated again. This causes the process to retry more often as more keys get generated (evenly freezing) and would be a huge concern on server side rendering. The proposed method is to use a non-random but incrementing variable.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/draft-js/issues/comments/249279273","html_url":"https://github.com/facebook/draft-js/pull/582#issuecomment-249279273","issue_url":"https://api.github.com/repos/facebook/draft-js/issues/582","id":249279273,"user":{"login":"khankuan","id":1406170,"avatar_url":"https://avatars.githubusercontent.com/u/1406170?v=3","gravatar_id":"","url":"https://api.github.com/users/khankuan","html_url":"https://github.com/khankuan","followers_url":"https://api.github.com/users/khankuan/followers","following_url":"https://api.github.com/users/khankuan/following{/other_user}","gists_url":"https://api.github.com/users/khankuan/gists{/gist_id}","starred_url":"https://api.github.com/users/khankuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khankuan/subscriptions","organizations_url":"https://api.github.com/users/khankuan/orgs","repos_url":"https://api.github.com/users/khankuan/repos","events_url":"https://api.github.com/users/khankuan/events{/privacy}","received_events_url":"https://api.github.com/users/khankuan/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T19:16:29Z","updated_at":"2016-09-23T19:16:29Z","body":"The PR might still be buggy for SSR so i'm dropping it first. Will look deeper into usage of random keys."}}
{"actor":{"display_login":"khankuan"}}