View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0030566||2.x IDE Bugs||Saving||Public||2019-02-26 09:35||2020-02-04 11:53|
|Reporter||Stewart Bishop||Assigned To||Steven Campbell|
|Priority||Very High||Severity||C - General||Reproducibility||100%|
|Target Version||2.2.4||Fixed in Version||2.2.4|
|Summary||0030566: Saving: IDE silently deletes empty code files in a number of circumstances, triggers the File Watcher each time|
|Description||For GML and DnD projects, if you open your room's creation code and then close this code editor when the file is empty (either by never adding anything in to a new room, or by removing all the code from an existing room), the IDE will silently delete this empty code file off the disk.|
Similarly, creating a DnD code file of any type (timeline moments, scripts, object events), leaving it blank and then closing the code editor will also reproduce. GML projects don't repro these bits, as we don't delete the .gml file for these resources - likely because someone added a fix for this very issue at some point in the past.
For all of the above, after a few seconds the file watcher will alert you to a file being changed on disk. The "Reload" button is useless in this situation, as the deleted file will not be restored.
|Steps To Reproduce||1) Create any project|
2) Open the creation code for the room, but don't type anything in
4) Close the room creation code (or the room itself)
5) Wait a few seconds
6) See that this triggers a project modified (reload/save?) dialogue
1. Create a new DnD project
2. Create a new timeline resource.
3. Add a moment 0.
4. Don't type anything in the code editor.
5. Close the timeline.
6. Wait a few seconds.
7. See the file watcher.
|2.x IDE Found In||184.108.40.2063|
|2.x Runtime Found In||220.127.116.118|
|2.x IDE Verified In||18.104.22.1685|
|2.x Runtime Verified In||22.214.171.1241|
|In the second repro steps, it is erroneously triggering on a file that we intentionally delete...|
|The overarching issue here is that the file watcher takes the time that it notices a file being delete as the 'time of deletion' of that file... which may be anywhere within a (by default - users can change it) 2 second window. The file system tells the file watcher to ignore changes while it's making them (begin/end guards), but the file watcher ticks (by default) once every 2 seconds, coming back to that window. Because file deletion has no time stamp associated with it, it's the best it can do without communicating with the OS. So it should probably be communicating with the OS to fix this.|
Fixed in Red IDE/GItHub Pull Request 4724
Git Id: c76724268776505856b24ce341d8f718026a123f
Fixed for Objects, Timelines, Room Creation Code and Instance Creation Code.
Basically, a file wont be created until there's something to actually save...
Reopening. This is still occurring for scripts (both GML and DND).
Same reproduction steps.
Additional fix in Red IDE / GitHub Pull Request 4774
Git Id: f0da79a06df1f02eba399162fd5cb704becac44d
This adds consistency for Scripts, Notes and Shaders to only save something when there is something to save.