monzo / response

Monzo's real-time incident response and reporting tool ⚡️
MIT License
1.52k stars 165 forks source link

Enforce 1-to-1 relation between Incident and Comms Channel #175

Closed mattrco closed 4 years ago

mattrco commented 4 years ago

If the request to create a comms channel for an incident is repeated (e.g. by multiple users clicking the button) in quick succession, multiple comms channels can be created for the incident. This results in most operations failing because the length of the CommsChannel set for a given incident is assumed to be 1.

It is possible for two CommsChannel models to refer to the same slack channel since we don't enforce unique constraints on the comms channel model. This could be useful if multiple developers are using the same slack instance to test against (where the same automatically generated channel name might be used).