Repository navigation
fix(tw): isolate Taskwarrior data with TASKDATA and serialize CLI ops - #474
NaitikVerma6776 wants to merge 2 commits into
Conversation
cmd.Dir was not enough; Taskwarrior still used /root/.task and GET /tasks wiped it. Point TASKDATA/TASKRC at the per-request temp dir, drop the shared rm -rf, lock all CLI helpers, and log fetch errors. Fixes CCExtractor#471
|
Thank you for opening this PR! Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools. Please take a moment to:
More information on how to conduct a self review: This helps make the review process smoother and gives us a clearer understanding of your thought process. Once you've added your self-review, we'll continue from our side. Thank you! |
its-me-abhishek
left a comment
There was a problem hiding this comment.
Hi, correct me if I'm wrong but: I think we should rather add the Get Tasks to the job queue instead of modifying the queue (for now)
Since the server was built quite early on -- when Tsc probably didn't support concurrency, I couldn't implement it here.
But the Get tasks seems to be quite a fast process, along with others hence never caused any issues for a single instance.
So migrating it to one job queue now may make sense, in order to make this a concurrent thing in future (next Gsoc, probably :) or before that)
So i guess migrating the GET tasks to the job queue, via some way (maybe change the request type-or add it to the queue via our methods defined in backend). LMK your thoughts on this.
|
@its-me-abhishek i have updated the implementation to use |
Summary
/root/.taskdatabase:tasknow runs withTASKDATAandTASKRCinside each request temp dir (cmd.Diralone was not enough).rm -rf /root/.taskfrom fetch/add/complete/delete/modify helpers.GET /tasksand mutation jobs cannot overlap.GET /tasks; return[]instead of 500 when the task list is empty.Fixes #471
Test plan
go test ./utils/ ./utils/tw/(Taskwarrior tests still needtaskon PATH)TASKDATAis the temp dir (not/root/.task) and/root/.taskis not deleted as part of the requestGET /taskswith an in-flight add/edit; sync should not fail with SQLite 1032 from a concurrent wipe[]