Saved app state that survives version changes: lossy Codable decoding
For state persisted across app versions (onboarding answers, a resume position), synthesized Decodable throws on the first missing key or unknown enum raw value, which silently discards all of the user's progress after an update. Pattern that held up under test: keep synthesized encode(to:), hand-write init(from:) where every field is read with (try? container.decodeIfPresent(T.self, forKey: k)) ?? nil and falls back to the type's default; decode enum fields as String and map through init(rawValue:) (compactMap for arrays) so values a version does not know are dropped instead of fatal. Identify screens by stable string ids, not indexes, so reordering in config cannot corrupt a saved position. Also: Decimal does not round-trip exactly through JSONDecoder (it goes via Double), so store whole currency units or minor units as Int.