A React 19 + TypeScript 5.8 project uses a standard browser-based startup without SSR. Components are rendered inside React.StrictMode in development and production; behavior must be correct in both modes.
You need to check a small task status screen that:
GET /api/tasks/:id;done flag with a button;PATCH /api/tasks/:id with body { done: boolean };STATUS: <text>.Expected logic: when quickly switching to a new task, the old response must not overwrite the new one; if a request fails, the interface must not remain temporarily incorrect; a repeated render under StrictMode must not duplicate side effects.
You need to find and fix defects in the proposed diff. Assumptions: the API returns JSON of the form { id: string, title: string, done: boolean }, and PATCH returns the updated object in the same format.
React 19.0.0, TypeScript 5.8.4, Vite browser build, development and production, React.StrictMode enabled in development, no additional runtime dependencies
Use line comments to explain the problem, its impact, the fix and how to test it.