# Change: Add Concurrency Handling and Reliability Improvements ## Why Multiple users editing the same task simultaneously can lead to lost updates (last-write-wins). Trigger execution failures are not retried, causing permanent failures on transient errors. Soft-delete restore operation does not cascade to child tasks, leading to data inconsistency. ## What Changes - Implement optimistic locking using version field for task updates - Add retry mechanism with exponential backoff for trigger execution - Implement cascade restore for soft-deleted tasks and their children ## Impact - Affected specs: task-management, automation - Affected code: - `backend/app/models/task.py` - Add version field - `backend/app/api/tasks/router.py` - Optimistic locking logic - `backend/app/services/trigger_scheduler.py` - Retry mechanism - `backend/app/api/tasks/router.py` - Cascade restore