Because the local data will have an obsolete key and therefore the decode function will fail. But if I try to decode a [String: MyObject] instead of [MyEnum: MyObject], then I will get an error about how the dictionary was actually saved as a string with alternated values.
Is my only option to never drop any case of the enum?
I expect it to fail, but I don't expect it to not give a single way to handle the data (which isn't some unreadable binary but just plain String as an Enum).
I know that encoding/decoding doesn't handle versioning, it's not their responsibility but mine. However, Swift language doesn't give me any tool for that in this very specific case. If I knew that Enum was a pain to handle when adding a removing a case, I would never make it Codable in a Dictionary - because the way it is handled behind the scene doesn't feel natural in Swift.
It is easy to handle format changes in all the other cases, but not this one as the way Swift encodes/decodes data of Dictionary with Enum keys isn't explicit.
Anyway, I'll just keep my legacy cases for the moment...