fedora-messaging
fedora-messaging copied to clipboard
Two different value for severity in one Message object
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?
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.