Save fails silently when sketch out of sync with file system #2051
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
When the "Auto save" preference is disabled, any changes to a sketch made in the Arduino IDE editor are "staged" in memory until the user manually saves the sketch. The sketch file can be modified externally during that time. These conditions pose a danger of user data being lost when the sketch is saved.
When the user attempts to save the sketch under these conditions Arduino IDE detects the out of sync state and displays a dialog notifying the user of the situation and asking how to proceed:
🐛 If the user clicks the "YES" button in the dialog to indicate they wish to write the version of the sketch from the editor to disk, the write does not occur contrary to the user's directive.
To reproduce
☑
Auto save"// change made in IDE
UnsyncedSketch/UnsyncedSketch.ino
in a text editor.// change made externally
The "The file 'UnsyncedSketch.ino' has been changed on the file system." dialog opens.
🐛 The change made in the IDE editor is not saved to disk.
🐛 There is no indication to the user that their data was not saved other than the ⬤ ("dirty" state indicator) remaining on the sketch tab.
Expected behavior
When the user directs Arduino IDE to write the sketch to disk, it does so.
Arduino IDE version
964ea3b
Operating system
Windows
Operating system version
11
Additional context
I bisected the regression to e4beb03 (does not occur with the build of the previous commit dafb245).
Nothing is printed to the logs when the save fails.
Issue checklist
The text was updated successfully, but these errors were encountered: