agemooij / riak-scala-client

An easy to use, non-blocking, fast Scala client library for interacting with Riak.
http://riak.scalapenos.com/
Apache License 2.0
84 stars 24 forks source link

Empty values in Riak get turned into None instead of Some(RiakValue("", ...)) #3

Closed agemooij closed 11 years ago

agemooij commented 11 years ago

The underlying spray-client entity.toOption call used when turning a raw value into a RiakValue has the ide effect of turning empty values (i.e. the key exists but the value is an empty string) into None instead of Some(RiakValue("", ...)).

Fix this by using Option(entity.toString) instead of entity.toOption

agemooij commented 11 years ago

Could not reproduce this, although the original occurrence might have been in a conflict resolution scenario with the magic X-Riak-Deleted property causing problems.

I added a unit test to verify that empty strings are properly supported as values. See commit cccff56c5c5cedb989a613e2ba7c96ace874bdca