Skip to content

Refactor EditTaskInTaskwarrior: Batch CLI Operations & Isolation Fix #372

@its-me-abhishek

Description

@its-me-abhishek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendSomething isn't working on the backendenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions