{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1558","repository_url":"https://api.github.com/repos/couchbase/sync_gateway","labels_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1558/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1558/comments","events_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1558/events","html_url":"https://github.com/couchbase/sync_gateway/issues/1558","id":130893631,"number":1558,"title":":4985/{db}/_role/ returns deleted roles","user":{"login":"sethrosetter","id":1365736,"avatar_url":"https://avatars.githubusercontent.com/u/1365736?v=3","gravatar_id":"","url":"https://api.github.com/users/sethrosetter","html_url":"https://github.com/sethrosetter","followers_url":"https://api.github.com/users/sethrosetter/followers","following_url":"https://api.github.com/users/sethrosetter/following{/other_user}","gists_url":"https://api.github.com/users/sethrosetter/gists{/gist_id}","starred_url":"https://api.github.com/users/sethrosetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethrosetter/subscriptions","organizations_url":"https://api.github.com/users/sethrosetter/orgs","repos_url":"https://api.github.com/users/sethrosetter/repos","events_url":"https://api.github.com/users/sethrosetter/events{/privacy}","received_events_url":"https://api.github.com/users/sethrosetter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-03T02:51:44Z","updated_at":"2016-02-03T06:39:58Z","closed_at":"2016-02-03T06:39:58Z","body":"Using Couchbase Sync Gateway/1.2.0(77;490449e)\r\n\r\nSteps to reproduce\r\n\r\n- Create two roles \r\n```\r\ncurl -X \"PUT\" \"http://localhost:4985/db/_role/tv_role\" \\\r\n\t-d $'{\r\n  \"admin_channels\": [\r\n    \"ABC\"\r\n  ],\r\n  \"name\": \"tv_role\"\r\n}'\r\n```\r\n```\r\ncurl -X \"POST\" \"http://localhost:4985/db/_role/\" \\\r\n\t-d $'{\r\n  \"admin_channels\": [\r\n    \"KTEK\"\r\n  ],\r\n  \"name\": \"dj_role\"\r\n}'\r\n```\r\n- Get the roles\r\n```\r\ncurl -X \"GET\" \"http://localhost:4985/db/_role/\"\r\n```\r\nResponse:\r\n```\r\n[\"dj_role\",\"tv_role\"]\r\n```\r\n- Delete one role\r\n```\r\ncurl -X \"DELETE\" \"http://localhost:4985/db/_role/tv_role\"\r\n```\r\n- Try to get the deleted role by name\r\n```\r\ncurl -X \"GET\" \"http://localhost:4985/db/_role/tv_role\"\r\n```\r\nResponse:\r\n```\r\n{\r\n  \"error\": \"not_found\",\r\n  \"reason\": \"missing\"\r\n}\r\n```\r\nIt appears the role has been deleted.\r\n- Get all the roles again.\r\n```\r\ncurl -X \"GET\" \"http://localhost:4985/db/_role/\"\r\n```\r\nResponse:\r\n```\r\n[\"dj_role\",\"tv_role\"]\r\n```\r\n\r\nExpected: The deleted role would not show up in the last step.\r\nActual: The deleted role shows up in in the last step."},"comment":{"url":"https://api.github.com/repos/couchbase/sync_gateway/issues/comments/179040682","html_url":"https://github.com/couchbase/sync_gateway/issues/1558#issuecomment-179040682","issue_url":"https://api.github.com/repos/couchbase/sync_gateway/issues/1558","id":179040682,"user":{"login":"adamcfraser","id":8866453,"avatar_url":"https://avatars.githubusercontent.com/u/8866453?v=3","gravatar_id":"","url":"https://api.github.com/users/adamcfraser","html_url":"https://github.com/adamcfraser","followers_url":"https://api.github.com/users/adamcfraser/followers","following_url":"https://api.github.com/users/adamcfraser/following{/other_user}","gists_url":"https://api.github.com/users/adamcfraser/gists{/gist_id}","starred_url":"https://api.github.com/users/adamcfraser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamcfraser/subscriptions","organizations_url":"https://api.github.com/users/adamcfraser/orgs","repos_url":"https://api.github.com/users/adamcfraser/repos","events_url":"https://api.github.com/users/adamcfraser/events{/privacy}","received_events_url":"https://api.github.com/users/adamcfraser/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T06:39:58Z","updated_at":"2016-02-03T06:39:58Z","body":"Expect this to be the same root cause as #1557 - same scenario.  Closing as duplicate, will add note about roles to #1557."}}