ccsync icon indicating copy to clipboard operation
ccsync copied to clipboard

Refactor EditTaskInTaskwarrior: Batch CLI Operations & Isolation Fix

Open its-me-abhishek opened this issue 10 months ago • 3 comments

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

  1. 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.
  2. 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 avatar Jan 05 '26 14:01 its-me-abhishek

@its-me-abhishek I am picking this Issue. Will raise the PR by tommorow

Rustix69 avatar Jan 05 '26 17:01 Rustix69

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!

Harshkamboj11 avatar Jan 05 '26 17:01 Harshkamboj11

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

khushalbhasin4488 avatar Jan 21 '26 08:01 khushalbhasin4488