Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355800

Summary: [Launch] Auto-delete of configurations - dangerous interaction with File Refresh hooks
Product: [Eclipse Project] Platform Reporter: Luke Usherwood <ldubox-coding101>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P2 CC: daniel_megert, Michael_Rennie, pawel.1.piech, remy.suen, sarika.sinha
Version: 4.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Luke Usherwood CLA 2011-08-25 03:48:28 EDT
Build Identifier: I20110613-1736

With both of the following options enabled:
 1. Workspace / Refresh using native hooks or polling
 2. Launch Configurations / Delete configurations when associated resource is deleted

If a change occurs on the filesystem (such as a folder being renamed or moved) then all launch configurations associated with resources within that location are deleted without chance of recovery. This can cause significant user data loss.

Bug 233773 states that the default for (2) has changed to false in 3.7. (It was true here - presumably because my old preference was retained after upgrade from 3.6?) 

I second the sentiments of https://bugs.eclipse.org/bugs/show_bug.cgi?id=233773#c13

I believe the deletion of these files is too dangerous to be performed automatically  - even as a preference. It breaks the usability rule that user mistakes should always be able to be undone (and in corner cases where that's not possible, at least prompt for confirmation before performing such an action.)

I would suggest removing the auto-delete option and instead have a manual "clean up" toolbar button, so that this handy tidying action can be user-initiated at a "safe" point in time. Perhaps a confirmation dialog would list the configurations to be deleted prior to removing them.



Reproducible: Always

Steps to Reproduce:
1. Have the two options selected, as described in the 'details'
2. Locate your favourite project in Windows Explorer
3. Rename a key source folder, such as "net" to "net,"
4. Say "oops" and press Ctrl-Z (it can be quite quickly)
5. Sob when it dawns on you that all launch configurations really have been permanently deleted.
Comment 1 Michael Rennie CLA 2011-09-15 15:37:45 EDT
I agree it would ideal to prompt the user if we are going to delete them. I think something as simple a checkbox list of all the configurations that would be deleted and let the user select the ones (or none) that they want to delete.

Reducing the severity and upping importance; the feature works for auto-deleting configurations, we just need to make it more user-friendly.
Comment 2 Luke Usherwood CLA 2011-10-13 08:47:03 EDT
Am I going insane, or did the option "Delete configurations when associated resource is deleted" (Run/Debug, Launching, Launch Configurations) get enabled after I upgraded to 3.7.1?

Quite likely the former. (I was probably testing this ticket and forgot to disable it again.)

Anyway, I lost all my launch configurations yet again, after a bad "svn switch" command using the command line. Great... 

At least I can recover the source files, but not the launch configurations.
Comment 3 Pawel Piech CLA 2011-10-24 16:25:55 EDT
Mike, I assume this won't make it into M3?
Comment 4 Michael Rennie CLA 2011-10-24 16:40:20 EDT
(In reply to comment #3)
> Mike, I assume this won't make it into M3?

You are correct, M3 is not going to happen.
Comment 5 Michael Rennie CLA 2012-04-25 00:12:08 EDT
This is not going to make it into My either, moving to 4.3
Comment 6 John Arthorne CLA 2012-06-05 09:58:57 EDT
P1 priority means we will not ship Juno without it. Since it is already targetted to 4.3/Kepler I will move to P2 priority.
Comment 7 Dani Megert CLA 2012-06-05 10:09:20 EDT
(In reply to comment #6)
> P1 priority means we will not ship Juno without it.

Well, strictly speaking, it means we will not ship the release/milestone indicated by the target milestone, and this is Kepler ;-).
Comment 8 Eclipse Genie CLA 2018-09-22 16:08:24 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 9 Lars Vogel CLA 2019-09-02 15:04:42 EDT
This bug has been marked as stalebug a while ago without any further interaction.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard flag.
Comment 10 Lars Vogel CLA 2019-09-02 15:11:58 EDT
This bug was marked as stalebug a while ago. Marking as worksforme.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.
Comment 11 Luke Usherwood CLA 2019-09-04 09:20:11 EDT
Hi, sorry for not checking back earlier - Issue still present.

I've just confirmed that preference (2.) still executes immediately upon resource refresh, without prompting.

NEW INFO: this is despite the following option, found one level higher in the tree, being checked:

 (3.) Run/Debug > Launching 

     [✓] "Prompt for confirmation when removing a configuration from the launch history"

Thus, even doing something like a git-bisect - whether done inside or outside of Eclipse (maybe I'm working on my C++ code in Visual Studio, for example) - can result in launch configuration files in Eclipse being silently zapped.

Having said that, having made (2.) default to OFF in Bug 233773 probably went a long way to mitigating this to only affect power-users and preference-tinkerers.

-------- 

IMHO I find that too many "knobs and dials" harms usability - and I could imagine both preferences (2.) and (3.) being eliminated. (YMMV)

 2.) As suggested, a manual "cleanup" action that can be executed from the Launch dialog, to zap all configurations that are unused at that point in time, I think would be nicer than:
 
  - a pop-up confirmation appearing out of nowhere
   (say, during that external git bisect.) 

  - the current dangerous behaviour 

 3.) Yeah, no-one likes extra popup dialogs, but a preference buried in some obscure place is not a great solution either. The user can multi-select (ctrl+click) before hitting delete, so a one-time confirmation shouldn't be that much of a burden. Esp. since there's no Undo.
Comment 12 Sarika Sinha CLA 2019-09-05 00:59:43 EDT
Thanks for confirming! Will analyze in 4.14.
Comment 13 Sarika Sinha CLA 2019-11-13 09:19:29 EST
There should be a dialog before removing the launch configurations, even if the preference is set.

If someone can take this up, will be available for review.
Comment 14 Sarika Sinha CLA 2019-11-13 09:20:13 EST
Downgrading to normal as preference is switched off by default.
Comment 15 Eclipse Genie CLA 2021-11-11 19:54:08 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.