{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/publishing-api/issues/113","labels_url":"https://api.github.com/repos/alphagov/publishing-api/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/publishing-api/issues/113/comments","events_url":"https://api.github.com/repos/alphagov/publishing-api/issues/113/events","html_url":"https://github.com/alphagov/publishing-api/pull/113","id":114628911,"number":113,"title":"Support optimistic locking on v2 endpoints.","user":{"login":"elliotcm","id":109225,"avatar_url":"https://avatars.githubusercontent.com/u/109225?v=3","gravatar_id":"","url":"https://api.github.com/users/elliotcm","html_url":"https://github.com/elliotcm","followers_url":"https://api.github.com/users/elliotcm/followers","following_url":"https://api.github.com/users/elliotcm/following{/other_user}","gists_url":"https://api.github.com/users/elliotcm/gists{/gist_id}","starred_url":"https://api.github.com/users/elliotcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elliotcm/subscriptions","organizations_url":"https://api.github.com/users/elliotcm/orgs","repos_url":"https://api.github.com/users/elliotcm/repos","events_url":"https://api.github.com/users/elliotcm/events{/privacy}","received_events_url":"https://api.github.com/users/elliotcm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-02T16:18:49Z","updated_at":"2015-11-03T14:26:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/publishing-api/pulls/113","html_url":"https://github.com/alphagov/publishing-api/pull/113","diff_url":"https://github.com/alphagov/publishing-api/pull/113.diff","patch_url":"https://github.com/alphagov/publishing-api/pull/113.patch"},"body":"This allows publisher applications to detect conflicts\r\nwhen (for example) a user has left their edit page\r\nopen for a long time and someone else has updated\r\nthe item in the meantime.\r\n\r\nIf the version the app thinks it's updating does\r\nnot match the version in the Publishing API, a 409\r\nConflict is returned.\r\n\r\nIf the `previous_version` key is not provided, no\r\nchecking is performed.  This makes this locking\r\nopt-in on the part of the publisher application.\r\n\r\nhttps://trello.com/c/s3dN4eDP/336-optimistic-locking\r\n\r\nClient changes here: https://github.com/alphagov/gds-api-adapters/pull/383"},"comment":{"url":"https://api.github.com/repos/alphagov/publishing-api/issues/comments/153370527","html_url":"https://github.com/alphagov/publishing-api/pull/113#issuecomment-153370527","issue_url":"https://api.github.com/repos/alphagov/publishing-api/issues/113","id":153370527,"user":{"login":"alext","id":5560,"avatar_url":"https://avatars.githubusercontent.com/u/5560?v=3","gravatar_id":"","url":"https://api.github.com/users/alext","html_url":"https://github.com/alext","followers_url":"https://api.github.com/users/alext/followers","following_url":"https://api.github.com/users/alext/following{/other_user}","gists_url":"https://api.github.com/users/alext/gists{/gist_id}","starred_url":"https://api.github.com/users/alext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alext/subscriptions","organizations_url":"https://api.github.com/users/alext/orgs","repos_url":"https://api.github.com/users/alext/repos","events_url":"https://api.github.com/users/alext/events{/privacy}","received_events_url":"https://api.github.com/users/alext/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T14:26:17Z","updated_at":"2015-11-03T14:26:17Z","body":"I feel this could do with some integration-level tests that cover things like nothing should be sent to the content-store etc when a version conflict is detected."}}