'delete link' feature' #32
Labels
No Label
bug
compatibility
documentation
duplicate
enhancement
future release
help wanted
invalid
non-code
question
refactor
testing
this release
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cmccabe/linkulator2#32
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One of the great things about a decentralized system is that users own their data and can delete it at any time. Rather than making users futz with their linkulator.data files, potentially corrupting other data, lets give them a [d] option to delete a post or response. If the user chooses to [d]elete a link that has replies, linkulator should warn them that both the link and all replies will no longer be visible to anyone.
Assuming all date stamps in a single user linkulator.data file are unique, we do it like this for links (not replies):
-- or do a regex to match lines that do not ^start with timestamp and write them back to the file
Maybe deleting replies should also be a feature, but that would require a much bigger refactoring because there is currently no view of a reply by itself when a user could choose to delete it. Nor do we display a reply ID that a user could reference when deleting.
'delete link/reply' feature'to 'delete link' feature'I'm unclear re: what happens to replies in the event of post deletion. If I have a post and you have replied and I delete my post, what happens to your reply? I am strongly of the opinion that it should not be deleted. If it is not deleted then a user can still reference it, it is just an orphan and will not be loaded by linkulator itself. This does potentially create overhead, but it gives true and unconditional ownership of data to not have another user have the power to delete your content (only remove theirs, which yours depends on).
That may be what is proposed, I just wanted to check in and see if I was understanding correctly.
You’re right — replies are not deleted (they can’t be b/c linkulator won’t have permission) and will simply become orphans that are not displayed.
An enhancement will be for linkulator to notify the user whenever they have orphans in their data file and ask if they want the orphans deleted. I think this is described in another Issue.
[EDIT:] But prompting users to delete orphans has a downside. Either it annoys users when it prompts them each time and they decline, or we have to additionally keep track of every decline they've made. Ideally, orphan management is something linkulator should handle, but these don't seem like elegant ways to do it. Do you have any other ideas?
Each orphan would have a unique ID. A list can be kept in the data file (maybe as a csv?) of all orphans that have been kept. Then when doing a sweep for deletion (in pseudo-code):
Something like that could work. It is more data to keep and manage. Not sure if it is worth it or not, but it is doable for sure.
I suggest we should not address orphaned replies as part of this issue. It is my opinion that it does not need addressing unless there is a good reason, like a measurable performance issue.
As for the original proposal, I agree with the suggestion.
One option could be to present a "modify" action instead of delete, with an interface similar to what you see when creating a link, but prefilled. That process would allow deletion.
The interface for replies could include an index as suggested, with a command like mn, where n is an index.
Regarding how the file data is handled, a suggestion here has similar redundancy without reading in to a list first.
I like your modify suggestion, asdf. The choice menu could say mo[d]ify or delete (where the [d] is underlined, not in brackets).
And that stackoverflow solution is good, and it is a simple improvement on bulleted sequence above.
I am fine with not addressing orphans now because, you're right, it certainly won't be an issue in the near term.