-
-
Notifications
You must be signed in to change notification settings - Fork 323
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 |
I see multiple use cases & problems clashing here. I think some separation & clarification is needed because I think the current discussion mixes a few things. In the following I attempt to analyze and conclude systematically: (Terms in doubled quotation marks are meant in a common technical sense, not referring to TaskWarrior (TW) terminology.) There are following requirements I see:
Following happens today (as I know & see it):
To conclude, 3. is mostly impossible as of today, or brings up the downsides as explained before in #3644 (comment). The obvious theoretical solution: a command to "delete" a task, fulfilling 3. (not 4.), while not breaking 5.. Without regard to the current implementation, this can be done by adding a redact "state", which can be synced by itself, but triggers the "removal" of all data despite metadata technically required for the redaction to be stored & synced further (for TW, I assume UUID is enough). As examples, see how Signal or Matrix implement that. Now clearly my personal opinion:
So I propose (possibly in multiple updates):
|
Ok sounds like I then need to write a small shell script to both delete and purge a task, wish the prompting would be disabled but I could pipe in characters. I'm surprised this is not more used. If I delete a task I consider it not be part of any stats so it should be purged as well. I.e. like 'rm -rf'. |
Thanks for summarizing the use-cases! Just as a technical point regarding option 3:
Irreversibly deleting data is essentially impossible in the storage model. By analogy, if you accidentally commit something and push it to GitHub, there's no way to delete that -- you just have to accept that it's been publicly disclosed. You can do things to make it less likely to be discovered accidentally (that's Also, note that So, I think the current options cover 1, 2, 4, and 5 adequately, and 3 is impossible. I agree that in some sense "cancel' might be a better term than "delete', but there are a lot of people out there typing |
I'm not sure I follow this. if you purge a task, create a snapshot, and then delete the old versions, where does the data remain? |
That data may still exist on other replicas; deleting versions is difficult do do without breaking other things (we had a discussion about this a year or so ago; and deleting data from a SQLite database doesn't make any guarantees that the data is not actually still present in free space; and similarly for filesystems. Note that the use of client-side encryption gets Fundamentally, I don't want to build a feature where we make a promise that redacting an incriminating task will prevent authorities from finding the task; or that redacting a task with a secret in it will prevent forensic analysis of the client from revealing that secret. We just can't meet that promise. |
Fair enough. I didn't account for the context of end-user 3's objectives when I read your response and I agree that we needn't try to accommodate that. To clarify: irreversible data deletion is difficult but under consideration (at least for taskchampion-sync-server) -- but this wont be guaranteed or predictable. |
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: