Refactor EditTaskInTaskwarrior: Batch CLI Operations & Isolation Fix
Description The EditTaskInTaskwarrior function is currently inefficient and dangerous for concurrent environments. Mostly due to the recent additions to the controller. It executes multiple independent shell commands for a single task update and manually deletes global data directories.
Required Changes
-
Batch Command Execution for better performance
- Action: Instead of calling utils.ExecCommand for every single field, build an argument slice ([]string) and execute one single task
modify command. - Reason: Spawning shell processes is expensive. Taskwarrior can be to handle multiple attribute changes in one go (e.g., task 1 modify project:Home due:tomorrow). This reduces execution time.
- Action: Instead of calling utils.ExecCommand for every single field, build an argument slice ([]string) and execute one single task
-
UUID over Task ID: Use the uuid for the modify command instead of the taskID. Though we use UUID on frontend, we probably need to update this here.
Acceptance Criteria
- [ ] Functions now batch all attributes into a single task modify call.
- [ ] Permanent UUID is used for modification instead of volatile taskID.
- [ ] Logic uses the models struct to prevent parameter bloat.
- [ ] The code is manually reviewed and relevant comments are present inside the code-review.
@its-me-abhishek I am picking this Issue. Will raise the PR by tommorow
Hey @its-me-abhishek I’ve opened a PR that addresses this issue.
The refactor batches all task updates into a single task modify command, switches to using the permanent UUID instead of taskID, and removes the unsafe deletion of global Taskwarrior data.
Please have a look when you get time — happy to make any changes or adjustments based on feedback. Thanks!
Hi @its-me-abhishek , i have raised a PR addressing this issue . Please have a look - whenever you have time. Happy to make changes based on your feedback. Thanks