Переглянути джерело

fix(mgmt): correctly handle return of `publish` when persistent sessions are enabled

firest 1 рік тому
батько
коміт
1853c1015a

+ 1 - 0
apps/emqx_management/src/emqx_mgmt_api_publish.erl

@@ -245,6 +245,7 @@ make_bad_req_reply(Reason) ->
 -spec is_ok_deliver({_NodeOrShare, _MatchedTopic, emqx_types:deliver_result()}) -> boolean().
 -spec is_ok_deliver({_NodeOrShare, _MatchedTopic, emqx_types:deliver_result()}) -> boolean().
 is_ok_deliver({_NodeOrShare, _MatchedTopic, ok}) -> true;
 is_ok_deliver({_NodeOrShare, _MatchedTopic, ok}) -> true;
 is_ok_deliver({_NodeOrShare, _MatchedTopic, {ok, _}}) -> true;
 is_ok_deliver({_NodeOrShare, _MatchedTopic, {ok, _}}) -> true;
+is_ok_deliver(persisted) -> true;
 is_ok_deliver({_NodeOrShare, _MatchedTopic, {error, _}}) -> false.
 is_ok_deliver({_NodeOrShare, _MatchedTopic, {error, _}}) -> false.
 
 
 %% @hidden Map MQTT publish result reason code to HTTP status code.
 %% @hidden Map MQTT publish result reason code to HTTP status code.

+ 2 - 0
changes/ce/fix-13832.en.md

@@ -0,0 +1,2 @@
+Fixed that the `Publish` endpoint would have a 500 error when persistent session were enabled.
+