fedora-messaging icon indicating copy to clipboard operation
fedora-messaging copied to clipboard

Two different value for severity in one Message object

Open sebwoj opened this issue 6 years ago • 1 comments

It is possible to set 2 different values for severity in object of class Message. In Message constructor, we can set severity via:

  • constructor argument "severity"
  • constructor argument "properties" (properties->headers->severity) Which of them should be source of truth?

sebwoj avatar Oct 05 '18 20:10 sebwoj

The header should always match the instance's severity. Right now if you construct it without a severity and then set it, though, it won't get reset on the header. One way to fix that is to use a property with a setter function.

Another way, which might solve other problems like this, is to construct the properties object just before sending if they weren't explicitly provided. This would need to happen in the api.publish method and also in the Twisted equivalent.

jeremycline avatar Oct 08 '18 16:10 jeremycline