Skip to content
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

[Core]: After deleting open file's parent folder, cannot Save changes and Save As shows incorrect error message #12354

Open
core-ai-bot opened this issue Aug 31, 2021 · 12 comments

Comments

@core-ai-bot
Copy link
Member

Issue by julieyuan
Tuesday Aug 13, 2013 at 04:37 GMT
Originally opened as adobe/brackets#4760


Steps:

  1. Edit two files with same name under different folders and don't save the files.
  2. Delete one folder which contains one of the two files.
  3. Click Delete button on the Confirm Delete dialog.
  4. On the pop up dialog File Deleted, click the button Keep Changes in Editor.
  5. On the working Files area, right click the file which's folder is deleted, and save it.
  6. After step4, on the working Files area, right click the file which's folder is deleted, and choose save as.

Result:
At step5, it will pop up Error saving file and can not save the file.
At step6, after you save as the file to another name, it will pop up two dialog. First dialog is Error opening file dialog, second one is External Changes dialog.

Expected:
It should can save the file, at least should save as the file without error message.

ENV: MAC10.8 English OS
Build: 0.29.0-8678

Snapshots:
Please refer to snapshots for details:
Step2:
screen shot 2013-08-12 at 20 42 31

After Step4:
screen shot 2013-08-12 at 20 43 37

After Step5:
screen shot 2013-08-12 at 20 44 16

After Step6:
screen shot 2013-08-12 at 20 45 55
screen shot 2013-08-12 at 20 46 10

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday Aug 13, 2013 at 16:39 GMT


To@redmunds. Marking low priority given how unlikely the scenario is, but could raise the priority if it seems like there's a more general issue.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Nov 13, 2013 at 08:17 GMT


Copying over some thoughts from PR #5614...

I wonder what the right user experience is. What do other editors do here? It seems like there are at least three options:

  1. Leave editors open if they have unsaved changes (close the rest). When you switch to those editors, pop up the existing delete-vs-unsaved conflict dialog.
  2. If any applicable editors have unsaved changes, roll those filenames into the folder-delete confirmation dialog. In other words, the choices are agree to lose all those unsved changes or cancel deleting the folder. Thus no editors with unsaved changes can be left open after the folder was been deleted by Brackets. (This is similar to our atomic bulk confirmation dialog on quit).
  3. Automatically turn such editors into untitled documents. (This seems a little odd to me but I could swear I've seen Sublime do this in some cases... so it seemed worth including).

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 00:48 GMT


I like solution 3 (as I also stated in pull request #5614).

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Friday Nov 15, 2013 at 17:17 GMT


I just added more comments to pull request #5614, so be sure to read both threads!

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Jan 03, 2014 at 04:27 GMT


There's a forum thread suggesting that landing file-watchers will reduce the impact of this bug slightly: the file is correctly saved when you choose Save As, but you still see the two spurious error dialogs.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Feb 04, 2014 at 00:44 GMT


Amending description & title (was "[Core][Keep changes in Editor]: Can not save or save as a file which is deleted from File tree but be kept in Editor.") to reflect the bug more clearly. The title didn't make it clear that this only happens when deleting folders, and the behavior has also improved slightly.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Feb 04, 2014 at 00:48 GMT


Now that #6744 has landed, I wonder if the simplest solution here would be to just make sure the Save and Save As operations work correctly. (Save would need to recreate the parent folder chain as needed, so maybe we shouldn't fix that case and instead just make it give a clearer error message; but Save As seems like it shouldn't be hard to fix).

The original options 1-3 above are all slightly nicer UI-wise, but they all seem more complex to implement as well.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Monday Apr 21, 2014 at 21:19 GMT


Nominating for 1.0

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Monday Apr 28, 2014 at 19:38 GMT


Note: In dupe #7594,@pthiess reports that if you quit Brackets while in this state (and choose not to save changes), when you reopen Brackets and it tries to restore the working set you'll get another error dialog when it tries to load the now-nonexistent file.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Monday Aug 04, 2014 at 19:48 GMT


See also #8610, which is about the lesser (but still slightly confusing) issues that arise when deleting the file itself (not its containing folder). If we do something here we might want to extend it to cover that case too.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Aug 12, 2014 at 16:56 GMT


I tried this again (since it has Brackets 1.0 Milestone). I do not see the "External Changes dialog" as stated in the Results section. The file is being saved (with "Save As", not "Save") as stated in the Expected section. So, is this now Fixed?

I think the "Save" command in step 5 should behave the same as the "Save As" in step 6. Is that functionality captured somewhere else?

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Aug 15, 2014 at 22:05 GMT


Reviewed -- keeping in as low priority / opportunistic for 1.0.

New plan for the simplest possible behavior:

  • Make sure Save As works (@redmunds thinks it does already)
  • In Save, check if the parent folder exists, and if not just invoke Save As instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant