Would you consider fallbacks here? That is, if decoding fails, to fall back to the next encoding type? That way you don't have to worry about mid-flight changes and would make it more robust. Failure on decoding would be very rare anyway so an extra try shouldn't realistically affect performance.