davesteele / todo.txt-gtd

My recipe for customizing todo.txt for Getting Things Done
GNU General Public License v2.0
18 stars 0 forks source link

tdtproj [project] deletes tasks without a project listed underneath _None #3

Closed flocentblack closed 11 months ago

flocentblack commented 1 year ago

tdtproj [project] undesirably deletes tasks that are not assigned to a project listed underneath _None

tdtproj without [project] does not delete tasks underneath _None

flocentblack commented 1 year ago

Just noticed tdtproj with out [project] creates duplicates of tasks underneath _None

davesteele commented 1 year ago

It should never delete a task (I've never seen that happen), but it will move them around if the project designation contradicts the current project.

Are you sure you didn't just lose track of the task, entered it again, then saw there were two?

flocentblack commented 1 year ago

Yes, At first I thought they (multiple tasks) might have got moved somewhere else in the todo.txt or moved to done.txt, but they are definitely gone.

I readded the missing tasks, created a backup and tried to replicate the action that was causing my tasks without a project to disappear and observed the behavior above. As long as I do not use tdtproj everything is fine.

davesteele commented 1 year ago

Ok, a little background on how tdtproj works. It parses the todo.txt file, pulling out the desired project(s) to a temporary file, and opens that file with an editor. Any saves you make are to that temporary file. Upon completion, todo.txt is again opened and parsed, the old content of the edited projects is removed, then the temp file is processed into the file, and everything is saved

If you are losing tasks, it's likely due to interaction with another program that is interacting with todo.txt. Do you have multiple tdtproj sessions open at once? Is todo.txt open in an editor, with a subsequent save?

flocentblack commented 1 year ago
  1. todo.txt is not open in any program or editor.

  2. $ cat todo.txt to verify contents.

  3. Created copy for backup.

  4. $ lsrproj #featherpad opens todo.txt, contents good. No changes made, closed without saving.

  5. $ cat todo.txt #contents under "_None" are duplicated with one blank line between the original group and copied group of tasks.

  6. $ lsproj order #featherpad opens and displays tasks for the "order" project. Closed without saving.

  7. $ cat todo.txt #All tasks underneath "_None" were removed.

davesteele commented 1 year ago

(assuming lsrproj is a misspell)

Try e.g. "project -l [filtertext]" for a project list.

lsprj (aliased to lsproj) is not part of a standard dep install, and is not therefore directly involved in the hooks that make the GTD stuff work. If it were to, say, open overlapping topydo sessions in the course of doing it's processing, I could believe that you could see what you are seeing.

Can project -l provide your lsproj needs?

flocentblack commented 1 year ago

I get command not found when trying "project -l"

I don't see project.py in /local/lib/python3.7/site-packages/tdtgtd/

davesteele commented 1 year ago

"project" is a console script pointer to tdtproj. It should be created on your path with "install". it is the visible endpoint with a deb package install.

flocentblack commented 1 year ago

I'm sorry, I meant tdtproj (not lsrproj)

flocentblack commented 1 year ago

project [project] works great and does not cause _None tasks to be removed.

Thanks!