Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridges): fix default value for enable when attempting operations #12696

Merged
merged 1 commit into from Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/emqx_bridge/src/emqx_bridge_api.erl
Expand Up @@ -764,7 +764,7 @@ is_bridge_enabled_v1(BridgeType, BridgeName) ->
%% we read from the translated config because the defaults are populated here.
try emqx:get_config([bridges, BridgeType, binary_to_existing_atom(BridgeName)]) of
ConfMap ->
maps:get(enable, ConfMap, false)
maps:get(enable, ConfMap, true)
catch
error:{config_not_found, _} ->
throw(not_found);
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_bridge/src/emqx_bridge_v2_api.erl
Expand Up @@ -990,7 +990,7 @@ call_operation_if_enabled(NodeOrAll, OperFunc, [Nodes, ConfRootKey, BridgeType,
is_enabled_bridge(ConfRootKey, BridgeType, BridgeName) ->
try emqx_bridge_v2:lookup(ConfRootKey, BridgeType, binary_to_existing_atom(BridgeName)) of
{ok, #{raw_config := ConfMap}} ->
maps:get(<<"enable">>, ConfMap, false);
maps:get(<<"enable">>, ConfMap, true);
{error, not_found} ->
throw(not_found)
catch
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_connector/src/emqx_connector_api.erl
Expand Up @@ -532,7 +532,7 @@ call_operation_if_enabled(NodeOrAll, OperFunc, [Nodes, BridgeType, BridgeName])
is_enabled_connector(ConnectorType, ConnectorName) ->
try emqx:get_config([connectors, ConnectorType, binary_to_existing_atom(ConnectorName)]) of
ConfMap ->
maps:get(enable, ConfMap, false)
maps:get(enable, ConfMap, true)
catch
error:{config_not_found, _} ->
throw(not_found);
Expand Down
1 change: 1 addition & 0 deletions changes/ce/fix-12696.en.md
@@ -0,0 +1 @@
Fixed an issue where attempting to reconnect an action or source could lead to the wrong error message being returned in the HTTP API.