{"action":"created","issue":{"url":"https://api.github.com/repos/drewkerrigan/riak-elixir-client/issues/32","repository_url":"https://api.github.com/repos/drewkerrigan/riak-elixir-client","labels_url":"https://api.github.com/repos/drewkerrigan/riak-elixir-client/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/drewkerrigan/riak-elixir-client/issues/32/comments","events_url":"https://api.github.com/repos/drewkerrigan/riak-elixir-client/issues/32/events","html_url":"https://github.com/drewkerrigan/riak-elixir-client/issues/32","id":141977441,"number":32,"title":"Unable to set a disabled flag on a map","user":{"login":"gausby","id":482052,"avatar_url":"https://avatars.githubusercontent.com/u/482052?v=3","gravatar_id":"","url":"https://api.github.com/users/gausby","html_url":"https://github.com/gausby","followers_url":"https://api.github.com/users/gausby/followers","following_url":"https://api.github.com/users/gausby/following{/other_user}","gists_url":"https://api.github.com/users/gausby/gists{/gist_id}","starred_url":"https://api.github.com/users/gausby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gausby/subscriptions","organizations_url":"https://api.github.com/users/gausby/orgs","repos_url":"https://api.github.com/users/gausby/repos","events_url":"https://api.github.com/users/gausby/events{/privacy}","received_events_url":"https://api.github.com/users/gausby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-03-18T21:03:32Z","updated_at":"2016-07-22T19:35:22Z","closed_at":null,"body":"I don't know if this is the desired behaviour, but I seems that disabling a flag on a map will cause an error to be raised. The following will show an iex session where a disabled flag is set on a map, which will cause a crash, and one where an enabled flag will be set correctly on a map.\r\n```elixir\r\niex(1)> Riak.CRDT.Map.new |> Riak.CRDT.Map.put(\"test\", Riak.CRDT.Flag.new |> Riak.CRDT.Flag.disable)\r\n** (throw) :context_required\r\n    (riakc) src/riakc_flag.erl:102: :riakc_flag.disable/1\r\niex(1)> Riak.CRDT.Map.new |> Riak.CRDT.Map.put(\"test\", Riak.CRDT.Flag.new |> Riak.CRDT.Flag.enable)\r\n{:map, [], [{{\"test\", :flag}, {:flag, false, :enable, :undefined}}], [],\r\n :undefined}\r\niex(2)> \r\n```\r\nWe have discussed this before #19 but I guess having this in an issue would be fitting until we have resolved this issue."},"comment":{"url":"https://api.github.com/repos/drewkerrigan/riak-elixir-client/issues/comments/234635917","html_url":"https://github.com/drewkerrigan/riak-elixir-client/issues/32#issuecomment-234635917","issue_url":"https://api.github.com/repos/drewkerrigan/riak-elixir-client/issues/32","id":234635917,"user":{"login":"drewkerrigan","id":438879,"avatar_url":"https://avatars.githubusercontent.com/u/438879?v=3","gravatar_id":"","url":"https://api.github.com/users/drewkerrigan","html_url":"https://github.com/drewkerrigan","followers_url":"https://api.github.com/users/drewkerrigan/followers","following_url":"https://api.github.com/users/drewkerrigan/following{/other_user}","gists_url":"https://api.github.com/users/drewkerrigan/gists{/gist_id}","starred_url":"https://api.github.com/users/drewkerrigan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewkerrigan/subscriptions","organizations_url":"https://api.github.com/users/drewkerrigan/orgs","repos_url":"https://api.github.com/users/drewkerrigan/repos","events_url":"https://api.github.com/users/drewkerrigan/events{/privacy}","received_events_url":"https://api.github.com/users/drewkerrigan/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T19:35:21Z","updated_at":"2016-07-22T19:35:21Z","body":"I did some more digging on this, the erlang riak client lib prevents a flag without context from getting disabled: https://github.com/basho/riak-erlang-client/blob/develop/src/riakc_flag.erl#L102\n\nHowever... I did some hacking and manually created a flag record with a `:disable` op and saved it as new, and Riak didn't seem to mind at all, and correctly returned the value of the flag as false after i did a `Riak.find` on it. I think we can work around this artificial limitation in the riak-erlang-client, but it may be a little sloppy."}}
{"actor":{"display_login":"drewkerrigan"}}