Alan refactored it live:

The junior developer, Sarah, asked, "Where does the socket disconnect logic go?"

Alan sat up in bed. "No more," he whispered. At 8:00 AM, he walked into the "war room." The team was exhausted. Juniors were frantically adding console.log statements. The product manager was asking, "Can we just wrap it in a try/catch ?"

"In the initialize function. Not in a useEffect cleanup. Not in a component. The service manages its own lifecycle. The React app just subscribes to the results." Three months later, Black Friday hit.