View Issue Details

IDProjectCategoryView StatusLast Update
00305662.x IDE BugsSavingPublic2019-09-26 13:19
ReporterStewart BishopAssigned ToSteven Campbell 
PriorityVery HighSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
Product Version2.2.2 
Target Version2.2.4Fixed in Version2.2.4 
Summary0030566: Saving: IDE silently deletes empty code files in a number of circumstances, triggers the File Watcher each time
DescriptionFor 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 Reproduce1) 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
Repro: 100%

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.
Repro: 100%
TagsGM2KI, IDE, thatsit
2.x IDE Found In2.2.2.393
2.x Runtime Found In2.2.2.308
2.x IDE Verified In9.2.1.1945
2.x Runtime Verified In9.9.1.1531

Relationships

related to 0031384 ClosedSteven Campbell Room Editor: Copying an instance does not copy its instance creation code 

Activities

Dan

2019-02-26 16:31

Adminstrator  

Alexander Borup

2019-04-02 16:02

Developer   ~0063574

In the second repro steps, it is erroneously triggering on a file that we intentionally delete...

Alexander Borup

2019-04-09 11:35

Developer   ~0063598

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.

Steven Campbell

2019-07-16 16:22

Manager   ~0064439

Fixed in Red IDE/GItHub Pull Request 4724
Git Id: c76724268776505856b24ce341d8f718026a123f

Steven Campbell

2019-07-16 16:23

Manager   ~0064440

Fixed for Objects, Timelines, Room Creation Code and Instance Creation Code.
Basically, a file wont be created until there's something to actually save...

Matthew McInnes

2019-08-01 15:15

Developer   ~0064526

Reopening. This is still occurring for scripts (both GML and DND).

Same reproduction steps.

Steven Campbell

2019-08-02 12:41

Manager   ~0064527

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.