-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hidden tasks containing only projects/contexts gets deleted #220
Comments
@dlaidig can you please check if the todo is actually being deleted from the file? Although I havn't looked into it yet, I think it's just not loaded, as sleek filters tasks with no text. It also doesn't let you create tasks with no actual text. This is a behavior from the days before the hidden todo function got introduced. I could enhande this by letting sleek create and read todos that contain the h: attribute. |
Yes, I checked the files after they were modified by sleek and the hidden line was removed. |
Ok I found the reason and it will be fixed in the next release. Also empty todos with h:1 attribute can now be created within sleek (led to a warning before). Thanks for reporting it. |
Hi @dlaidig. Could you please check, if this behavior is still present in https://github.com/ransome1/sleek/releases/tag/v1.1.0-rc.4? |
Thanks for the very fast fix! I checked this version and for the example I posted, this does not happen any more. However, with
the first task is not shown in sleek and if I check the second task, the first one silently get deleted from the file. I am aware of #68 (and personally, I am not very likely to create a task like that since I do not use projects/contexts that much), but "silently deleting data" is the bug category that makes me a bit concerned about trusting sleek with important personal data, to be honest. I will keep testing since sleek is awesome to use (and with threshold dates and the "due:+" syntax, it finally supports my use case), but I guess I will keep monitoring the changes it does to my todo.txt files with git for quite some time... |
This is the behavior by design. Tasks with empty text fields are being removed from the file. Except when they are marked with h:1. I guess a less strict behavior can be implemented with which the line won't get removed but just ignored. I understand your concern and as this application works directly with your files (and not with a database) there will always be a risk that something might happen. It didn't so far but creating backups is essential. Edit: It's basically a one liner, that is being removed with the next released. The creation of todos in sleek with no text will still not be possible though. |
I am sorry, but if a consequence of the design is that sleek silently deletes entries that are valid according to the todo.txt specification and contain information (call dad), I would say then sleek should claim that it "makes use of the todo.txt format". Backups only help if you notice that data is missing. If some tasks get deleted, you usually do not find that out or you find it out too late due to the consequences of not dealing with the task in time. (Sorry for the harsh reply. I just couldn't ignore the "behavior by design" explanation. I appreciate you fixing the issue so quickly and will test the next version.) |
I'm not sure if your example is actually valid by the todo.txt standard. As far as I understand the basic rules (https://github.com/todotxt/todo.txt/raw/master/description.svg) the only element that is not optional is the description itself. But if I'm mistaken I won't argue against it. |
That svg also shows that projects and contexts are part of the description, i.e. the description for my example is |
Fixed in v1.1.0-rc.6, so I'm closing this issue now. :) |
thank you @dlaidig |
Is it an actual bug?
Yes. (And I am very happy that I carefully checked the diff of my todo.txt files after testing sleek.)
Did you check if the bug has already been reported?
Yes.
Describe the bug
My todo.txt files contain a hidden entry to define projects/contexts. When Sleek modifies the file, e.g., when marking a task as completed, this entry gets deleted.
With this task, the "hidden" toggle also does not work properly and does not seem to have any effect.
To Reproduce
Create the following todo.txt file and check the test task. The hidden task gets deleted.
If the hidden tasks contains regular text, this does not seem to happen:
Do you see any error entries in sleeks developer tools?
No.
Expected behavior
The hidden task should not get deleted.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: