The compiler should catch missing state cases, not your QA team
Adding a new state to your machine is easy. Remembering to update every switch statement is not.
State machines start clean. Three values, three switch branches. Then retry logic adds a fourth state. Partial failure adds a fifth. You update the reducer,…