GitHub IssuesEvent at 2015-01-01 21:52:06
Repository: benoitc/couchbeam
Actor: iambumblehead
Payload: {"action":"opened","issue":{"url":"https://api.github.com/repos/benoitc/couchbeam/issues/124","labels_url":"https://api.github.com/repos/benoitc/couchbeam/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/benoitc/couchbeam/issues/124/comments","events_url":"https://api.github.com/repos/benoitc/couchbeam/issues/124/events","html_url":"https://github.com/benoitc/couchbeam/issues/124","id":53229640,"number":124,"title":"`couchbeam:doc_exists/2` returns the wrong value.","user":{"login":"iambumblehead","id":2058705,"avatar_url":"https://avatars.githubusercontent.com/u/2058705?v=3","gravatar_id":"","url":"https://api.github.com/users/iambumblehead","html_url":"https://github.com/iambumblehead","followers_url":"https://api.github.com/users/iambumblehead/followers","following_url":"https://api.github.com/users/iambumblehead/following{/other_user}","gists_url":"https://api.github.com/users/iambumblehead/gists{/gist_id}","starred_url":"https://api.github.com/users/iambumblehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iambumblehead/subscriptions","organizations_url":"https://api.github.com/users/iambumblehead/orgs","repos_url":"https://api.github.com/users/iambumblehead/repos","events_url":"https://api.github.com/users/iambumblehead/events{/privacy}","received_events_url":"https://api.github.com/users/iambumblehead/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-01T21:52:05Z","updated_at":"2015-01-01T21:52:05Z","closed_at":null,"body":"`couchbeam:doc_exists/2` returns the wrong value.\r\n\r\nI encounter this in any recently tagged branch (I recently upgraded from version 1.0.7 [I think] and did not have this problem there). \r\n\r\nOf course if I try to create the design doc (again) couchbeam returns an error, `{error,conflict}`\r\n\r\n```erl\r\n%% open the design doc, see that it exists.\r\nUrl = \"http://localhost:5984\",\r\nAuth = [{basic_auth,{<<\"jumpyday\">>,<<\"glo9go99!goB\">>}}],\r\nServer = couchbeam:server_connection(Url, Auth),\r\nOptions = [],\r\n{ok, Db} = couchbeam:open_db(Server, \"user-test\"),\r\nDocName = <<\"_design/testuser\">>,\r\ncouchbeam:open_doc(Db, DocName).\r\n%% {ok,{[{<<\"_id\">>,<<\"_design/testuser\">>},\r\n%%       {<<\"_rev\">>,<<\"1-17d95a6f5b71dff90129febc7dc5fb7b\">>},\r\n%%       {<<\"language\">>,<<\"javascript\">>},\r\n%%       {<<\"views\">>,\r\n%%        {[{<<\"test\">>,\r\n%%           {[{<<\"map\">>,\r\n%%              <<\"function (doc) {\\n if (doc.type == \\\"test\\\") {\\n emi\"...>>}]}},\r\n%%          {<<\"test2\">>,\r\n%%           {[{<<\"map\">>,\r\n%%              <<\"function (doc) {\\n if (doc.type == \\\"test2\\\") {\"...>>}]}},\r\n%%          {<<\"user_name\">>,\r\n%%           {[{<<\"map\">>,\r\n%%              <<\"function (doc) { if (doc.name) emit(doc.\"...>>}]}}]}}]}}\r\n%%\r\n%%\r\n%% now try using doc_exists/2 -it returns false :(\r\ncouchbeam:doc_exists(Db, DocName).\r\n%% false\r\n```"}}