Skip to content

Commit 43e96a2

Browse files
authored
fix!: trigger target decoding is now compliant to the typespec (#133)
BREAKING CHANGE: The trigger target decoding function now returns a map, in order to be compliant with the defined type specifications. Signed-off-by: Riccardo Nalgi <riccardo.nalgi@secomind.com>
1 parent 94bd693 commit 43e96a2

File tree

1 file changed

+1
-5
lines changed
  • lib/astarte_core/triggers/simple_triggers_protobuf

1 file changed

+1
-5
lines changed

lib/astarte_core/triggers/simple_triggers_protobuf/utils.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ defmodule Astarte.Core.Triggers.SimpleTriggersProtobuf.Utils do
2626

2727
alias Astarte.Core.Triggers.SimpleTriggersProtobuf.TriggerTargetContainer
2828
alias Astarte.Core.Triggers.SimpleTriggersProtobuf.SimpleTriggerContainer
29-
alias Astarte.Core.Triggers.SimpleTriggersProtobuf.AMQPTriggerTarget
3029

3130
@any_device_object_id <<140, 77, 4, 17, 75, 202, 11, 92, 131, 72, 15, 167, 65, 149, 191, 244>>
3231
@any_interface_object_id <<247, 238, 60, 243, 184, 175, 236, 43, 25, 242, 126, 91, 253, 141, 17,
@@ -67,10 +66,7 @@ defmodule Astarte.Core.Triggers.SimpleTriggersProtobuf.Utils do
6766
trigger_target: {_target_type, target}
6867
} = TriggerTargetContainer.decode(payload)
6968

70-
%AMQPTriggerTarget{static_headers: static_headers_map} = target
71-
72-
# Use a list of pairs instead of a map be compatible with old (exprotobuf) decoding
73-
%{target | static_headers: Enum.into(static_headers_map, [])}
69+
target
7470
end
7571

7672
def deserialize_simple_trigger(payload) do

0 commit comments

Comments
 (0)