Skip to content

messageTrait not applied when message not used in a channel #210

@c-pius

Description

@c-pius

Description

We want to integrate the react component into our project for displaying specifications of messages to be implemented. Because the messages are not implemented but only specified by us, we define them only in the components/messages section and don't use the channels section (passing an empty object).

However, if the message is not referenced from a channel, it doesn't apply the used messageTraits to the message.

Expected result

Message traits should be applied to the message even if the message is not used in channel. All properties from the used trait should be shown as part of the message.

Actual result

Message trait is only applied if the message is used within a channel. In the case the message is used in a channel, you can see the properties from the trait in both the channel, and the message object.

Steps to reproduce
Find a minimal example here. The "light measured" message is used in a channel and the "commonHeaders" trait is applied correctly ("my-app-header" property shown in the channel and the message).

The "turn off" message is not used in a channel. The "commonHeaders" trait is NOT applied and you won't find the headers section with the "my-app-header" property.

message-channel-trait-example.txt

Troubleshooting

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions