- Refer to a populated group in a report draft (and it works fine)
- Remove all peers from the group (which effectively removes the group)
- Sync the reports and it will error because a report draft is referring to a group that doesn't exist (anymore)
One way to deal with this is to parse all report drafts whenever the last peer is being removed from a group and remove it wherever it's used. However, removing the last peer from a group is not explicit enough of a signal that the group will no longer be used, the user may add another peer to the group right after removing its last member. Updating drafts automatically will then cause reports to be mishandled, which is quite risky. So the current behavior feels preferable.