Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(issue): skip child-done notification when parent is in backlog (#4391)
Bohan Jiang5556f4570b9d
diff --git a/server/internal/handler/issue_child_done.go b/server/internal/handler/issue_child_done.goindex 0482e5795b..c629196a2a 100644--- a/server/internal/handler/issue_child_done.go+++ b/server/internal/handler/issue_child_done.go@@ -26,6 +26,11 @@ import (// - issue.ParentIssueID must be set// - parent must not be "done" or "cancelled" — the parent is already// closed and a notification has no follow-up to drive+// - parent must not be "backlog" — a parent parked in backlog is being+// deliberately held for later; waking its assignee (which can then+// promote sibling backlog sub-issues into todo) is exactly the+// unwanted auto-activation reported in #4320 / MUL-3497. A parked+// parent stays inert until the user explicitly moves it out of backlog.// - parent assignee must not be a member (human). Humans read their// issues manually; an automated system comment is pure noise for them// and there is nothing to "trigger" on a human assignee. Skipping the@@ -66,6 +71,14 @@ func (h *Handler) notifyParentOfChildDone(ctx context.Context, prev, issue db.Isif parent.Status == "done" || parent.Status == "cancelled" {return}+ // A parent parked in backlog is deliberately held for later. Posting the+ // system comment would wake its assignee, and the woken agent can then+ // promote sibling backlog sub-issues into todo — the surprise auto-+ // activation reported in #4320 / MUL-3497. Skip the whole notification so+ // a backlog parent stays inert until the user explicitly promotes it.+ if parent.Status == "backlog" {+ return+ }// Human-assigned parents read their own timeline; an automated system// comment is just noise and there is no agent task to trigger. Skip the// whole notification (comment + mention + inbox row) — MUL-2538.diff --git a/server/internal/handler/issue_child_done_test.go b/server/internal/handler/issue_child_done_test.goindex 2bea9e8a8a..d9e8442ba4 100644--- a/server/internal/handler/issue_child_done_test.go+++ b/server/internal/handler/issue_child_done_test.go@@ -212,6 +212,22 @@ func TestChildDoneSkippedWhenParentCancelled(t *testing.T) {}}+// TestChildDoneSkippedWhenParentBacklog — a parent deliberately parked in+// `backlog` must not be woken when a child completes. Waking it would+// re-activate the parent assignee, which can then promote sibling backlog+// sub-issues into todo — the surprise auto-activation reported in #4320 /+// MUL-3497. No system comment, no trigger, until the user explicitly moves+// the parent out of backlog.+func TestChildDoneSkippedWhenParentBacklog(t *testing.T) {+ fx := newChildDoneFixture(t, "backlog")++ updateChildStatus(t, fx.child.ID, "done")++ if got := countSystemCommentsOn(t, fx.parent.ID); got != 0 {+ t.Errorf("parent at 'backlog' should not receive notification, got %d comments", got)+ }+}+// TestChildDoneSkippedWhenNoParent — an issue with no parent_issue_id must// not produce any system comment on anything.func TestChildDoneSkippedWhenNoParent(t *testing.T) {