basho/riak-erlang-client — pull request #196 by russelldb (2014-09-21 16:09:43+00:00)
Title: A PB list element is encoded as the empty list when absent, not undefined

When performing a `riakc_pb_socket:get(Key, Val, [deletedvclock])` in the case that a tombstone was returned by riak, the client returned `{ok, RiakcObj}` and not `{error, notfound, TombstoneVClock}` as expected. The fault comes from the function clause expecting the `content` field of `#rpbgetresp` to be `undefined` for a tombstone, when it is in fact the empty list.

To test, set up a cluster with `{delete_mode, keep}`, add a key, delete it, fetch the tombstone with `riakc_pb_socket:get(Key, Val, [deletedvclock])`. Before the patch you well get an `{ok, Val}` return, after you will get `{error, notfound, VC}` where `VC` is the tombstone vlclock.