Skip to content

Conversation

@danielkweon
Copy link
Contributor

@danielkweon danielkweon commented Dec 14, 2025

Summary
Implements bidirectional linking for task Parent Task and Subtasks properties. Changes to either property automatically update the other side atomically.

Behaviors:

  • Setting Parent Task → adds to parent's Subtasks, removes from old parent
  • Setting Subtasks → updates each subtask's Parent Task accordingly
  • Soft-deleting a task → unlinks from parent and subtasks
  • Validates against self-references and circular references

Changes:

  • properties: Added link_parent_task / link_subtasks across all layers
  • properties_service: set_entity_property uses bidirectional linking for Tasks
  • document_storage_service: Unlinking on soft delete

@danielkweon danielkweon requested a review from a team as a code owner December 14, 2025 01:56
@linear
Copy link

linear bot commented Dec 14, 2025

@danielkweon danielkweon self-assigned this Dec 14, 2025
Add link_parent_task and link_subtasks methods to PropertiesRepo trait
for atomic bidirectional linking between parent tasks and subtasks.
…to helper

Move generic entity property update logic to entity_property_queries.rs
for cleaner separation. No functionality change.
Implements atomic bidirectional linking for Parent Task and Subtasks
properties. When setting a task's parent, the task is automatically
added to that parent's subtasks (and removed from old parent's).
When setting subtasks, each subtask's parent is updated accordingly.
Adds link_parent_task and link_subtasks to PropertiesService trait
and implementation, delegating to the repository layer.
When setting Parent Task or Subtasks on a Task entity, the endpoint
now calls the service layer's link methods for atomic bidirectional
updates. Non-task entities fall through to normal upsert.
When a document is soft deleted, if it's a task, clear its Parent Task
and Subtasks bidirectionally. This ensures deleted tasks don't appear
in other tasks' relationships.
- Prevent tasks from being their own parent or subtask
- Prevent mutual parent/subtask relationships (circular references)
- Deduplicate subtask IDs before processing
- Fix bug where parent subtasks updated for non-existent tasks
@danielkweon danielkweon force-pushed the daniel/m-5401--add-properties-be-link-tasks-for-parent-and-sub branch from f6b1e07 to db6351b Compare December 15, 2025 16:57
@danielkweon danielkweon merged commit ebe46ba into main Dec 15, 2025
37 checks passed
@danielkweon danielkweon deleted the daniel/m-5401--add-properties-be-link-tasks-for-parent-and-sub branch December 15, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants