Open vega113 opened 9 years ago
in CouchbaseFutures.waitForGetAndCas[T](future: OperationFuture[CASValue[Object]], b: CouchbaseBucket, ec: ExecutionContext, r: Reads[T]): Future[CASValue[T]]
The Reads[T] is never used to deserialize the result. So you end up always passing a String. This is a bug.
Response of getAndLock fails with class cast exception. Here's the following cast:
f.get().asInstanceOf[CASValue[T]]
However, f is of type OperationFuture[CASValue[Object]], so the getValue of the CASValue returns String. In comparison, the regular bucket.get() uses the Reads[T] to parse the value, i.e.case doc: String => Some(r.reads(Json.parse(doc)))