{"action":"created","issue":{"url":"https://api.github.com/repos/slimjack/IWC/issues/4","labels_url":"https://api.github.com/repos/slimjack/IWC/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/slimjack/IWC/issues/4/comments","events_url":"https://api.github.com/repos/slimjack/IWC/issues/4/events","html_url":"https://github.com/slimjack/IWC/issues/4","id":74085975,"number":4,"title":"'locking\" broken","user":{"login":"tejacques","id":1389520,"avatar_url":"https://avatars.githubusercontent.com/u/1389520?v=3","gravatar_id":"","url":"https://api.github.com/users/tejacques","html_url":"https://github.com/tejacques","followers_url":"https://api.github.com/users/tejacques/followers","following_url":"https://api.github.com/users/tejacques/following{/other_user}","gists_url":"https://api.github.com/users/tejacques/gists{/gist_id}","starred_url":"https://api.github.com/users/tejacques/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejacques/subscriptions","organizations_url":"https://api.github.com/users/tejacques/orgs","repos_url":"https://api.github.com/users/tejacques/repos","events_url":"https://api.github.com/users/tejacques/events{/privacy}","received_events_url":"https://api.github.com/users/tejacques/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-07T18:39:04Z","updated_at":"2015-09-01T06:52:26Z","closed_at":null,"body":"From my testing, using locking over localStorage as a mechanism is fundamentally broken due to the way the localStorage data propagation model works. An example is this:\r\n  - open two windows on the same domain and start a busy loop in each.\r\n  - attempt to acquire the lock in window 1 in 1 second after both windows are open, and hold it for 2s before releasing it, and the lock in window 2 after ~2 seconds, also hold it for 2s before releasing it.\r\n  - both windows will hold the 'lock' at the same time, ~2 seconds in to ~3 seconds in.\r\n  - This happens because localStorage propagates changes with events, and if the event loop is not yielded to, localStorage does not get updated. This may not be true of ALL browsers, but it's true of most."},"comment":{"url":"https://api.github.com/repos/slimjack/IWC/issues/comments/136605094","html_url":"https://github.com/slimjack/IWC/issues/4#issuecomment-136605094","issue_url":"https://api.github.com/repos/slimjack/IWC/issues/4","id":136605094,"user":{"login":"andrewwakeling","id":1066963,"avatar_url":"https://avatars.githubusercontent.com/u/1066963?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewwakeling","html_url":"https://github.com/andrewwakeling","followers_url":"https://api.github.com/users/andrewwakeling/followers","following_url":"https://api.github.com/users/andrewwakeling/following{/other_user}","gists_url":"https://api.github.com/users/andrewwakeling/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewwakeling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewwakeling/subscriptions","organizations_url":"https://api.github.com/users/andrewwakeling/orgs","repos_url":"https://api.github.com/users/andrewwakeling/repos","events_url":"https://api.github.com/users/andrewwakeling/events{/privacy}","received_events_url":"https://api.github.com/users/andrewwakeling/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T06:52:26Z","updated_at":"2015-09-01T06:52:26Z","body":"For Chrome 44, in my example, it appears that the value is now written to local storage immediately (i.e. If you go to a 2nd tab, evaluating localStorage['foo'] will be '1')."}}