Skip to content

No confirmation on closing window with unsaved changes #862

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

Closed
per1234 opened this issue Feb 24, 2022 · 1 comment · Fixed by #893
Closed

No confirmation on closing window with unsaved changes #862

per1234 opened this issue Feb 24, 2022 · 1 comment · Fixed by #893
Assignees
Labels
conclusion: resolved Issue was resolved criticality: highest Of highest impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Feb 24, 2022

Describe the bug

Unsaved changes to the sketch will be lost when closing the window. For this reason, the IDE must request confirmation from the user before proceeding, as is the standard convention for any application.

🐛 The IDE closes without confirmation even when the sketch has unsaved changes. This may cause loss of data for users who expect the standard "save and quit" behavior.

To Reproduce

  1. Open any sketch.
  2. Select File > Preferences... from the Arduino IDE menus.
  3. Uncheck the box next to "🗹 Auto save".
  4. Click the OK button.
  5. Make any change to the sketch.
    ❗ Do not save the sketch.
  6. Select File > Close from the Arduino IDE menus.

🐛 The window closes immediately and all unsaved changes are lost.

Expected behavior

Confirmation dialog when closing IDE window with unsaved changes.

Desktop

Original

  • OS: Windows 10, Ubuntu 20.04
  • Version: 2.0.0-rc4-snapshot-0207778
    Date: 2022-02-23T15:40:32.443Z
    CLI Version: 0.21.0 [10107d24]

Last verified with

  • OS: Windows 10, Ubuntu 20.04
  • Version: 2.0.0-rc4-snapshot-70f1c5f
    Date: 2022-03-09T10:47:19.505Z
    CLI Version: 0.21.0 [10107d24]

Additional context

I bisected the bug to 112153f (it does not occur when using the build from the previous commit 69ac1f4).


The bug occurs no matter which method you use to close the window:

  • File > Close
  • File > Quit
  • Native window close control

The bug also occurs with new sketches that have unsaved changes when the sketch is closed by these methods:

  • File > Quit
  • Native window close control

(There is a dialog on File > Close with a new dirty sketch)


Originally reported by @UKHeliBob at https://forum.arduino.cc/t/no-prompt-to-save-a-modified-file-when-closing-the-ide/962323

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Feb 24, 2022
@ubidefeo ubidefeo added the criticality: highest Of highest impact label Mar 24, 2022
@fstasi fstasi assigned msujew and unassigned AlbyIanna Apr 1, 2022
@msujew
Copy link
Contributor

msujew commented Apr 12, 2022

This will be addressed by my changes in #893 (once it works correctly on Mac)

@msujew msujew linked a pull request Apr 12, 2022 that will close this issue
4 tasks
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jun 1, 2022
@per1234 per1234 mentioned this issue Jun 1, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved criticality: highest Of highest impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants