Skip to content

[Bug]: archiving a parent task silently deadlocks dependent children in todo #23180

@SimbaKingjoe

Description

@SimbaKingjoe

Current Behavior

When a task is archived via archive_task, dependent child tasks are left permanently stuck in todorecompute_ready only checks for status == 'done', so an archived parent never satisfies the gate.

1. create parent A
2. create child B with parent=A, child C with parent=A
3. archive A
   → B and C stay todo forever (recompute_ready promotes 0 tasks)

There is no warning when archiving a task that has dependent children. The user archives a parent, forgets about the children, and they silently rot in todo.

Proposed Solution

When archive_task is called on a task that has dependent child tasks (non-archived children linked via task_links), give the user a choice:

Task 'A' has 2 dependent child tasks: B, C.
What should happen to them?

  [1] Unlink — remove the dependency on A and let them proceed
  [2] Archive — also archive B and C
  [3] Cancel — don't archive A either

Implementation sketch:

  • A new helper dependent_child_ids(conn, parent_id) -> list[str] queries children
  • The caller checks before calling archive_task
  • If children exist, present the choice; if none, archive immediately

This is an interaction change — no modification to dependency resolution semantics.

Alternative / Follow-up

A simpler variant is warning-only. Separately, whether archived should be treated as terminal for dependency resolution (child auto-promotes) can be discussed as its own follow-up.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/pluginsPlugin system and bundled pluginstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions