This commit addresses a critical bug where subtasks would disappear when updating the parent task (e.g., assigning tags). The issue had multiple potential causes: 1. Backend vulnerability: The updateSubtasks() function would delete all subtasks if an empty array was sent, treating it as "delete everything not in this list" 2. Frontend state management: After reloading a task, subtasks weren't being preserved if the backend response didn't include them 3. Unclear error messages: "Invalid parent task" errors didn't provide enough context for debugging Changes: - Added defensive logging in updateSubtasks() to warn when all subtasks are being deleted with an empty array - Enhanced validateParentTaskAccess() error messages to provide detailed diagnostics (task not found vs. permission issues vs. wrong user) - Updated handleTagsUpdate() in TaskDetails to explicitly preserve subtasks when reloading task after tag updates This fix is defensive in nature and adds better observability for diagnosing similar issues in the future. Fixes issue reported by user where subtasks disappeared after assigning tags to parent task, and "Invalid parent task" errors occurred when trying to update the orphaned subtasks. |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| components | ||
| config | ||
| constants | ||
| contexts | ||
| entities | ||
| hooks | ||
| store | ||
| styles | ||
| utils | ||
| App.tsx | ||
| i18n.ts | ||
| index.tsx | ||
| Layout.tsx | ||