Why can't we change variant attribute values?

Hi there!

In our business we’re planning on using variants (to track item sizes) and are expecting a lot of mistakes to be made, so that we’ll need to change the size after the fact.

I know that changing the attribute value is disabled (and enforced by the validator), but I’m wondering why we can’t change the attribute value?

The best I can think of is that it’s a legacy restriction from before self.rename was able to change the item code, as the variant attribute value is used to set the item code.

In our case, we have a custom field in the item for the size as well (from before we started looking at variants). I’ve set up the item validator to populate this field for the attribute value: for backwards compatibility. I’m thinking the way forward is to use updates to this field to rename the item (code) and also update the variant attribute value.

I’ve been testing it out and so far have not noticed any issues (ledgers and references are updated), but I’m worried this could lead to some less noticeable issues down the road.

I’m hoping someone has some insight in to this as to why we can’t change attribute values and if it would be safe to update the values then trigger a rename?