Describe the bug
When a user double-clicks the status dropdown on a task card rapidly, the optimistic UI update and the actual API response can conflict, causing the task to revert to its previous status unexpectedly.
Steps to reproduce
- Open Dashboard with several tasks
- Find a task in "To Do" status
- Rapidly click the status dropdown twice before the first request completes
- Observe: task flickers between states or gets stuck
Expected behavior
The last user action should win. The status should settle on whatever the user last selected.
Actual behavior
Task status reverts to previous value or shows a stale state.
Root cause hypothesis
useUpdateTask uses optimistic updates but doesn't cancel in-flight mutations. Two concurrent PATCH requests for the same task can resolve out of order.
Describe the bug
When a user double-clicks the status dropdown on a task card rapidly, the optimistic UI update and the actual API response can conflict, causing the task to revert to its previous status unexpectedly.
Steps to reproduce
Expected behavior
The last user action should win. The status should settle on whatever the user last selected.
Actual behavior
Task status reverts to previous value or shows a stale state.
Root cause hypothesis
useUpdateTaskuses optimistic updates but doesn't cancel in-flight mutations. Two concurrent PATCH requests for the same task can resolve out of order.