- Go to the “tags default notifications” for a group
- Add a tag to “watching”
- Save
- Remove the tag from “watching”
- Add the same tag to “tracking”
- Save
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "idx_group_tag_notification_defaults_unique" DETAIL: Key (group_id, tag_id)=(45, 36) already exists.
Looks like the code does not first remove the records that need to be removed and then adds the records that need to be added, but tries to do it all at once.
Pressing “Save” in between removing it and adding it works around the issue.
The interface in user preferences does not allow this by the way, you are unable to select it for another category if you just removed it - you are forced to press Save first.