-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
task delete should also purge #3644
Comments
Huh, I didn't realize There is an option to automatically purge deleted tasks after a period of time -- is that sufficient for you? Why do they need to be purged? |
As mentioned, I have yet to find a case in my taskwarrior workflow where I don't both delete and purge an unnecessary task, doing this all the time. Now I could do do task delete; task purge but then I'm getting all the prompts for asking if I really want to do it (which I want). I agree that task should never have option flags, rather key words, maybe |
Why do you need to purge and not just delete tasks? |
I almost always purge after deleting also, but there are some use cases where I wouldn't, such as when doing infrequent "maintenance" or trimming of my task database, I probably wouldn't purge until the end of making such a pass, once I was satisfied I hadn't deleted anything by mistake. Purge is useful is so they are removed from the database entirely, and don't show up at all anymore, for example for test/junk tasks that should end up like they never existed. There are some reasons enumerated in #3399 and I was very happy that However I would not want purge to happen automatically, just like I don't want gc to happen automatically; it is better off explicit, so I hope we can have this only be an option (if implemented) and not change it for everyone. The idea of making (Also, not sure if still the case with the TaskChampion backend, but note that 2b88260 seems to imply that gc is done automatically upon purge, and that's another reason not to want to auto-purge when deleting, because it would forcibly change the ID numbers.) |
Deleting test tasks makes sense. But in general I'd recommend setting up your filters, etc. so that deleted tasks don't show up. Then if one is deleted by accident, it's easy to recover it. Note that weird things will happen if a task is purged and modified on another replica. Imagine task 1444db41 "take out the trash":
At the end of this sequence, both replicas will agree that there is a completed task with no description or any other identifying information. This isn't an issue if there's no sync going on, and shouldn't be a problem for test tasks that aren't modified on multiple replicas. And even if it does happen, it's not going to cause any great harm -- it's just a weird situation [1]. But, this is why I make the recommendation above. Anyway, optionally allowing [1] Actually, this might cause errors in Taskwarrior right now, but that's a bug -- I'll work on fixing those up. |
There are two different states here: deleted, and non-existent. People have different workflows. I've read posts from people that use "deleted" to mark tasks as "not now" or "NAKed" and then undelete them later if they get time/permission to work on them (I don't do this, but I've seen it). This is different from not existing... To extrapolate from your premise, there's no need to even have a "purge" function at all, but I find it useful to have the two different states. I probably would never want to expire deleted tasks, I would rather purge them explicitly if I wanted them gone. It appears that this is the whole reason
I don't know the new sync model; could some kind of conflict-resolution algorithm be used, ie halting sync and forcing manual selection of which truth, or designating a primary replicant that's always right, or earliest/latest update wins? Your scenario would probably only come up with teams working on the same database, or by accident, though, I think? Actually, your scenario has two different ending states for the task: one where it doesn't exist at all, and one where it exists but is marked completed. (I assume completed tasks are never expired?) That does seem like a fundamental disagreement. Probably if the task exists vs not exists, the existing version should be copied to all the replicants, to be safe?
It probably doesn't need to be optional, since currently it just isn't allowed and a purge would bomb if not yet deleted. I can't see anyone using this guard as a "feature" but rather something they forgot to do (delete it first). And if they deleted without purging, they still want it to be there. |
This is a consequence of the conflict-resolution algorithm. Broadly, deleting things is hard in distributed systems, and typically the solution is what is referred to as "tombstones", which means you just mark an object as deleted and then don't show it. And that is exactly of what the "Deleted' status is! The scenario would come up with a person syncing the same database between multiple systems. I don't really know how teams would use TaskWarrior -- it's not a common use-case, anyway.
Now that I look at that example again, I think the task will always end up deleted on both replicas. I'd need to think for a bit longer to be sure. The sync does guarantee that all replicas end up in the same state -- it's just a question of what state. Anyway, I bring up the example just to say that there are downsides to purging tasks. If the convenience of not having deleted tasks in |
To request a feature...
Clearly describe the feature.
task delete should have an option or a flag to purge at the same time
Clearly state the use case. We are only interested in use cases, do not waste time with implementation details or suggested syntax.
In 99 of 100 cases I want to purge a task at the same time as I delete it. Just now I don't actually have a single work flow where I need to keep a task around after it has been deleted. There's no need to also make this verbal with yes/no responses.
The text was updated successfully, but these errors were encountered: