fix(tauri): surface errors from toggle_task cascade
When a parent task was toggled, `update_task` failures on child tasks were silently swallowed with `let _ = ...`, leaving subtasks out of sync with the parent's status and giving the user no feedback. Map the error and propagate so the UI can show it and the user can retry.
This commit is contained in:
parent
6abe95692e
commit
7754ea4b45
|
|
@ -495,7 +495,9 @@ fn toggle_task(
|
||||||
TaskStatus::Backlog => child.uncomplete(),
|
TaskStatus::Backlog => child.uncomplete(),
|
||||||
TaskStatus::Completed => child.complete(),
|
TaskStatus::Completed => child.complete(),
|
||||||
}
|
}
|
||||||
let _ = repo.update_task(lid, child);
|
let child_id = child.id;
|
||||||
|
repo.update_task(lid, child)
|
||||||
|
.map_err(|e| format!("Failed to cascade to subtask {}: {}", child_id, e))?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(task)
|
Ok(task)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue