Consider you have an enum
:
const (
MuteFor1Hr requests.MutingVariation = iota + 1
MuteFor1Week
)
… and you want to add MuteFor24Hr
to it.
Don’t insert it in the middle. Most probably this clients use it by value, rather than by string
BAD:
const (
MuteFor1Hr requests.MutingVariation = iota + 1
MuteFor24Hr // New value
MuteFor1Week // This value was 2 and will become 3. REGRESSION.
)
OK:
const (
MuteFor15Min requests.MutingVariation = iota + 1
MuteFor1Week // This value remains 2
MuteFor24Hr // New value doesn't introduce a breaking change.
)
You might say that clients should not access this enum by number, and you would be right.
But this is the reality we have and for now we should be careful.
This PR:
https://github.com/status-im/status-go/pull/5020
Lead to a regression on both clients. Because it changed the enum
, which was used on clients by number. More details here: