I think that perhaps it is better if redirects are only created in response to published entries being saved. Because the check to remove conflicting redirects only happens if the entry is published, this can lead to a situation where circular redirects are possible (though they would have no effect since no 404 would be generated). It seems to me that it would be better coding practice and less surprising behavior for developers if the logic to create a redirect on entry change and the logic to remove conflicting redirects were the same (ie: both either do or don't care about whether the entry is published).
To repro:
create an entry that is not published
edit the entry and change the slug
notice that a redirect from old_slug to new_slug will have been created
edit the entry again and change the slug back to the old slug
notice that a redirect from new_slug to old_slug now exists alongside the redirect from old_slug to new_slug
I think that perhaps it is better if redirects are only created in response to published entries being saved. Because the check to remove conflicting redirects only happens if the entry is published, this can lead to a situation where circular redirects are possible (though they would have no effect since no 404 would be generated). It seems to me that it would be better coding practice and less surprising behavior for developers if the logic to create a redirect on entry change and the logic to remove conflicting redirects were the same (ie: both either do or don't care about whether the entry is published).
To repro: