Explorar o código

fix: deprecated `share` in `subopts`

JimMoen %!s(int64=2) %!d(string=hai) anos
pai
achega
0ca725ff25

+ 0 - 1
apps/emqx/src/emqx_types.erl

@@ -214,7 +214,6 @@
     rap := 0 | 1,
     nl := 0 | 1,
     qos := qos(),
-    share => binary(),
     atom() => term()
 }.
 -type reason_code() :: 0..16#FF.

+ 4 - 1
apps/emqx_exhook/priv/protos/exhook.proto

@@ -460,8 +460,11 @@ message SubOpts {
   // The QoS level
   uint32 qos = 1;
 
+  // deprecated
+  reserved 2;
+  reserved "share";
   // The group name for shared subscription
-  string share = 2;
+  // string share = 2;
 
   // The Retain Handling option (MQTT v5.0)
   //

+ 1 - 1
apps/emqx_exhook/src/emqx_exhook_handler.erl

@@ -192,7 +192,7 @@ on_session_subscribed(ClientInfo, Topic, SubOpts) ->
     Req = #{
         clientinfo => clientinfo(ClientInfo),
         topic => emqx_topic:maybe_format_share(Topic),
-        subopts => maps:with([qos, share, rh, rap, nl], SubOpts)
+        subopts => maps:with([qos, rh, rap, nl], SubOpts)
     },
     cast('session.subscribed', Req).
 

+ 1 - 3
apps/emqx_exhook/test/props/prop_exhook_hooks.erl

@@ -546,9 +546,7 @@ subopts(SubOpts) ->
         qos => maps:get(qos, SubOpts, 0),
         rh => maps:get(rh, SubOpts, 0),
         rap => maps:get(rap, SubOpts, 0),
-        nl => maps:get(nl, SubOpts, 0),
-        %% TOOD: FIXME for share-sub refactored
-        share => maps:get(share, SubOpts, <<>>)
+        nl => maps:get(nl, SubOpts, 0)
     }.
 
 authresult_to_bool(AuthResult) ->