diff --git a/RELNOTES.md b/RELNOTES.md index 8b51d31f..5837303a 100644 --- a/RELNOTES.md +++ b/RELNOTES.md @@ -1,8 +1,10 @@ Release Notes ============= +* [2.4.1](https://github.com/basho/riak-erlang-client/issues?q=milestone%3Ariak-erlang-client-2.4.1) + * OTP 19 support via updated dependencies and a few platform defines * [2.4.0](https://github.com/basho/riak-erlang-client/issues?q=milestone%3Ariak-erlang-client-2.4.0) * This release merges in the Riak timeseries code base from the `2.3.1-timeseries` and `2.3.2-timeseries` releases. * [2.1.2](https://github.com/basho/riak-erlang-client/issues?q=milestone%3Ariak-erlang-client-2.1.2) - * OTP 18 / 19 support + * OTP 18 support * Fix processing of response from Riak when Riak generates an object's key [PR](https://github.com/basho/riak-erlang-client/pull/289) diff --git a/rebar b/rebar index a543d531..13bcbf9a 100755 Binary files a/rebar and b/rebar differ diff --git a/rebar.config b/rebar.config index 163c58e9..916c03f3 100644 --- a/rebar.config +++ b/rebar.config @@ -8,11 +8,12 @@ debug_info, warnings_as_errors, {platform_define, "^[0-9]+", namespaced_types}, - {platform_define, "(?=^[0-9]+)(?!^17)", deprecated_now} + {platform_define, "(?=^[0-9]+)(?!^17)", deprecated_now}, + {platform_define, "^19", deprecated_19} ]}. {deps, [ - {riak_pb, "2.1.*", {git, "git://github.com/basho/riak_pb", {tag, "2.1.4.0"}}} + {riak_pb, "2.1.*", {git, "https://github.com/basho/riak_pb", {tag, "2.1.4.1"}}} ]}. {edoc_opts, [ diff --git a/src/riakc_obj.erl b/src/riakc_obj.erl index 14d063cf..e2bd83e5 100644 --- a/src/riakc_obj.erl +++ b/src/riakc_obj.erl @@ -123,17 +123,18 @@ %% ==================================================================== %% @doc Constructor for new riak client objects. --spec new(bucket(), key()) -> riakc_obj(). +-spec new(bucket(), key()) -> riakc_obj() | {error, atom()}. new(Bucket, Key) -> build_client_object(Bucket, Key, undefined). %% @doc Constructor for new riak client objects with an update value. --spec new(bucket(), key(), value()) -> riakc_obj(). +-spec new(bucket(), key(), value()) -> riakc_obj() | {error, atom()}. new(Bucket, Key, Value) -> build_client_object(Bucket, Key, Value). %% @doc Constructor for new riak client objects with an update value and content type. --spec new(bucket(), key(), value(), content_type()) -> riakc_obj(). +-spec new(bucket(), key(), value(), content_type()) -> + riakc_obj() | {error, atom()}. new(Bucket, Key, Value, ContentType) -> case build_client_object(Bucket, Key, Value) of {error, Reason} -> @@ -144,7 +145,7 @@ new(Bucket, Key, Value, ContentType) -> %% @doc Build a new riak client object with non-empty key -spec build_client_object(bucket(), key(), undefined | value()) -> - riakc_obj() | {error, atom()}. + riakc_obj() | {error, atom()}. build_client_object(<<>>, K, _) when is_binary(K) -> {error, zero_length_bucket}; build_client_object(B, <<>>, _) when is_binary(B) -> diff --git a/src/riakc_pb_socket.erl b/src/riakc_pb_socket.erl index a6455fd6..8a7eecd6 100644 --- a/src/riakc_pb_socket.erl +++ b/src/riakc_pb_socket.erl @@ -2380,7 +2380,11 @@ remove_queued_request(Ref, State) -> end. %% @private +-ifdef(deprecated_19). +mk_reqid() -> erlang:phash2(crypto:strong_rand_bytes(10)). % only has to be unique per-pid +-else. mk_reqid() -> erlang:phash2(crypto:rand_bytes(10)). % only has to be unique per-pid +-endif. %% @private wait_for_list(ReqId) ->