-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or requestperformancePerformance optimizationPerformance optimizationpriority:highHigh priorityHigh priority
Description
Overview
Wrap multiple dependency additions in single atomic transaction to prevent partial state.
Current Problem
When adding multiple dependencies (e.g., Task C depends on [A, B]), if dependency addition fails mid-way, we end up with partial state:
- C → A dependency created ✅
- C → B dependency fails ❌
- Result: Inconsistent state
Proposed Solution
async addDependencies(taskId: TaskId, dependsOn: TaskId[]): Promise<Result<void>> {
return tryCatch(() => {
this.db.transaction(() => {
for (const depId of dependsOn) {
// All succeed or all fail atomically
this.addDependencyStmt.run(taskId, depId, Date.now());
}
})();
});
}Benefits
- Prevents partial dependency state
- Ensures consistency for complex dependency chains
- Better error handling with rollback
Effort Estimate
1-2 hours
Priority
HIGH - Data consistency is critical
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestperformancePerformance optimizationPerformance optimizationpriority:highHigh priorityHigh priority