Skip to content

Commit 61eb6ee

Browse files
authored
Merge pull request #85 from folook/fix/task_system_one_way_synchronization
fix(task-system): sync blocks when adding blockedBy dependencies
2 parents 6ac84e9 + 66a8429 commit 61eb6ee

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

agents/s07_task_system.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ def update(self, task_id: int, status: str = None,
8888
self._clear_dependency(task_id)
8989
if add_blocked_by:
9090
task["blockedBy"] = list(set(task["blockedBy"] + add_blocked_by))
91+
# Bidirectional: also update the blocker tasks' blocks lists
92+
for blocker_id in add_blocked_by:
93+
try:
94+
blocker = self._load(blocker_id)
95+
if task_id not in blocker["blocks"]:
96+
blocker["blocks"].append(task_id)
97+
self._save(blocker)
98+
except ValueError:
99+
pass
91100
if add_blocks:
92101
task["blocks"] = list(set(task["blocks"] + add_blocks))
93102
# Bidirectional: also update the blocked tasks' blockedBy lists

0 commit comments

Comments
 (0)