{"action":"created","issue":{"url":"https://api.github.com/repos/porygonco/porybox/issues/183","repository_url":"https://api.github.com/repos/porygonco/porybox","labels_url":"https://api.github.com/repos/porygonco/porybox/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/porygonco/porybox/issues/183/comments","events_url":"https://api.github.com/repos/porygonco/porybox/issues/183/events","html_url":"https://github.com/porygonco/porybox/pull/183","id":162259697,"number":183,"title":"Fix concurrency issues","user":{"login":"not-an-aardvark","id":11638619,"avatar_url":"https://avatars.githubusercontent.com/u/11638619?v=3","gravatar_id":"","url":"https://api.github.com/users/not-an-aardvark","html_url":"https://github.com/not-an-aardvark","followers_url":"https://api.github.com/users/not-an-aardvark/followers","following_url":"https://api.github.com/users/not-an-aardvark/following{/other_user}","gists_url":"https://api.github.com/users/not-an-aardvark/gists{/gist_id}","starred_url":"https://api.github.com/users/not-an-aardvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-an-aardvark/subscriptions","organizations_url":"https://api.github.com/users/not-an-aardvark/orgs","repos_url":"https://api.github.com/users/not-an-aardvark/repos","events_url":"https://api.github.com/users/not-an-aardvark/events{/privacy}","received_events_url":"https://api.github.com/users/not-an-aardvark/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/porygonco/porybox/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-25T02:53:55Z","updated_at":"2016-06-25T06:25:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/porygonco/porybox/pulls/183","html_url":"https://github.com/porygonco/porybox/pull/183","diff_url":"https://github.com/porygonco/porybox/pull/183.diff","patch_url":"https://github.com/porygonco/porybox/pull/183.patch"},"body":"Fixes #157\r\n\r\ntl;dr We should avoid using waterline's `.save()` method for database models, and instead use .update() to make updates to the database. If a document is modified between the time that it is fetched and `.save()` is called, the changes will be overwritten by `.save()` but not by `.update()`.\r\n\r\nThere is still the possibility of leaving the database in an inconsistent state if connection is randomly lost (which is sort of difficult to avoid since mongo doesn't have transactions), but there shouldn't be any more race condition issues now."},"comment":{"url":"https://api.github.com/repos/porygonco/porybox/issues/comments/228515137","html_url":"https://github.com/porygonco/porybox/pull/183#issuecomment-228515137","issue_url":"https://api.github.com/repos/porygonco/porybox/issues/183","id":228515137,"user":{"login":"not-an-aardvark","id":11638619,"avatar_url":"https://avatars.githubusercontent.com/u/11638619?v=3","gravatar_id":"","url":"https://api.github.com/users/not-an-aardvark","html_url":"https://github.com/not-an-aardvark","followers_url":"https://api.github.com/users/not-an-aardvark/followers","following_url":"https://api.github.com/users/not-an-aardvark/following{/other_user}","gists_url":"https://api.github.com/users/not-an-aardvark/gists{/gist_id}","starred_url":"https://api.github.com/users/not-an-aardvark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/not-an-aardvark/subscriptions","organizations_url":"https://api.github.com/users/not-an-aardvark/orgs","repos_url":"https://api.github.com/users/not-an-aardvark/repos","events_url":"https://api.github.com/users/not-an-aardvark/events{/privacy}","received_events_url":"https://api.github.com/users/not-an-aardvark/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T06:25:02Z","updated_at":"2016-06-25T06:25:02Z","body":"I already fixed it, this can be merged whenever."}}
{"actor":{"display_login":"not-an-aardvark"}}