diff --git a/CHANGES-5.0.md b/CHANGES-5.0.md index 734b88515..bf9afb3fb 100644 --- a/CHANGES-5.0.md +++ b/CHANGES-5.0.md @@ -1,3 +1,9 @@ +# 5.0.6 + +## Bug fixes + +* Remove the needless `will_msg` field from the client API. [#8721](https://github.com/emqx/emqx/pull/8721) + # 5.0.5 ## Bug fixes diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index ed9821eac..574305a4f 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -2094,9 +2094,9 @@ sc(Type, Meta) -> hoconsc:mk(Type, Meta). map(Name, Type) -> hoconsc:map(Name, Type). -ref(Field) -> hoconsc:ref(?MODULE, Field). +ref(StructName) -> hoconsc:ref(?MODULE, StructName). -ref(Module, Field) -> hoconsc:ref(Module, Field). +ref(Module, StructName) -> hoconsc:ref(Module, StructName). mk_duration(Desc, OverrideMeta) -> DefaultMeta = #{ diff --git a/apps/emqx_management/src/emqx_mgmt_api_clients.erl b/apps/emqx_management/src/emqx_mgmt_api_clients.erl index 0fd158dbd..19bf63f66 100644 --- a/apps/emqx_management/src/emqx_mgmt_api_clients.erl +++ b/apps/emqx_management/src/emqx_mgmt_api_clients.erl @@ -538,7 +538,6 @@ fields(client) -> })}, {username, hoconsc:mk(binary(), #{desc => <<"User name of client when connecting">>})}, {mountpoint, hoconsc:mk(binary(), #{desc => <<"Topic mountpoint">>})}, - {will_msg, hoconsc:mk(binary(), #{desc => <<"Client will message">>})}, {zone, hoconsc:mk(binary(), #{ desc => @@ -885,7 +884,8 @@ format_channel_info({_, ClientInfo0, ClientStats}) -> [memory, next_pkt_id, total_heap_size], maps:from_list(ClientStats) ), - ClientInfoMap0 = maps:fold(fun take_maps_from_inner/3, #{}, ClientInfo2), + ClientInfo3 = maps:remove(will_msg, ClientInfo2), + ClientInfoMap0 = maps:fold(fun take_maps_from_inner/3, #{}, ClientInfo3), {IpAddress, Port} = peername_dispart(maps:get(peername, ClientInfoMap0)), Connected = maps:get(conn_state, ClientInfoMap0) =:= connected, ClientInfoMap1 = maps:merge(StatsMap, ClientInfoMap0), diff --git a/build b/build index fb1b9f698..5f0c96744 100755 --- a/build +++ b/build @@ -17,10 +17,29 @@ fi PROFILE_ARG="$1" ARTIFACT="$2" -if [[ "${PROFILE:-${PROFILE_ARG}}" != "$PROFILE_ARG" ]]; then - echo "PROFILE env var is set to '$PROFILE', but '$0' arg1 is '$1'" - exit 1 -fi +is_enterprise() { + case "$1" in + *enterprise*) + echo 'yes' + ;; + *) + echo 'no' + ;; + esac +} +PROFILE_ENV="${PROFILE:-${PROFILE_ARG}}" +case "$(is_enterprise "$PROFILE_ARG"),$(is_enterprise "$PROFILE_ENV")" in + 'yes,yes') + true + ;; + 'no,no') + true + ;; + *) + echo "PROFILE env var is set to '$PROFILE_ENV', but '$0' arg1 is '$PROFILE_ARG'" + exit 1 + ;; +esac # make sure PROFILE is exported, it is needed by rebar.config.erl PROFILE=$PROFILE_ARG @@ -91,11 +110,11 @@ make_docs() { else libs_dir3='' fi - case $PROFILE in - emqx-enterprise) + case "$(is_enterprise "$PROFILE")" in + 'yes') SCHEMA_MODULE='emqx_ee_conf_schema' ;; - *) + 'no') SCHEMA_MODULE='emqx_conf_schema' ;; esac @@ -290,11 +309,11 @@ export_release_vars() { local erl_opts=() - case "$profile" in - *enterprise*) + case "$(is_enterprise "$profile")" in + 'yes') erl_opts+=( "{d, 'EMQX_RELEASE_EDITION', ee}" ) ;; - *) + 'no') erl_opts+=( "{d, 'EMQX_RELEASE_EDITION', ce}" ) ;; esac