inky icon indicating copy to clipboard operation
inky copied to clipboard

Wiped out ink files bug

Open joethephish opened this issue 9 years ago • 10 comments

We've had two reports of a major but seemingly hard to reproduce bug where the contents of an ink file get wiped out, with no way to undo the operation.

It seems like it has something to do with include files, and possibly to do with copy pasting.

We need to find a solid repro!

In the meantime, we highly recommend committing regularly to source control.

joethephish avatar Jul 23 '16 08:07 joethephish

I just had this bug. It wiped out the main file and the first 8 of 13 included files.

Details:

  • I copy&pasted the files to usb 4 hours before this.
  • I had two other unrelated ink files open.
  • I double clicked on the main file.
  • Opened file was empty. And so was the other 8 included files. But the last 5 was untouched.
  • Last modified date is the time of opening this file.
  • Inky was running for a long time. (Maybe 3+ days, left it running when I put the computer to sleep)

I'm using the latest (0.37.8) Mac version. Please let me know if I can provide any specific info.

Luckily I have many back-ups, and didn't lose any progress.

firat0 avatar Aug 01 '16 13:08 firat0

Oh dear, sorry to hear this, but glad you didn't have any data loss! Thanks for the report.

Hmm, odd that it doesn't seem to correlate too closely with other reports. In particular, it's surprising that it was after a fresh open of the project...

joethephish avatar Aug 01 '16 16:08 joethephish

Logging another instance of this: @joningold just had it too. It was also after having Inky open for a while, and after having slept his machine. After coming back to it, his include files were marked as unsaved, and he instinctively saved them, but they were all blank.

It must be something to do with the way that include files are discovered/created.

  • INCLUDE lines are parsed (continuously, as you make changes). If the named file is found on disk, it is loaded, if it isn't already.
    • Otherwise, it creates a new empty file <-- this must be what's happening when it's going wrong, though I have no idea how. It would have to have lost its reference to the file and load a new version of the file from disk.
  • Ink files can also be loaded based on a file watcher that continuously scans for ink files in the current directory and other subdirectories. This is so that you can get an "Unused files" section, especially useful when you're swapping include lines around.

joethephish avatar Aug 04 '16 11:08 joethephish

I had the blank file error occur today and managed to recover my project by toggling the developer tools open (they were closed throughout creation). I wish I had more details -- I was pretty surprised (relieved) when the text reappeared.

Some other notes:

  • I'm on Win7
  • Looking at my file in the folder showed a size of 0KB, but when searched it showed a size of 7KB (weird)

No other files open, not other applications other than Chrome.

jakewlandis avatar Aug 22 '16 00:08 jakewlandis

Ah, curious indeed. So when you toggled developer tools, the text reappeared, without doing anything else? Very odd!

joethephish avatar Aug 22 '16 08:08 joethephish

Yeah, almost as if it was redrawn or re-associated. I'll definitely try and reproduce it and log further details.

jakewlandis avatar Aug 22 '16 12:08 jakewlandis

Note that I've fixed a similar-ish bug in https://github.com/inkle/inky/issues/62. I'll be interested to see whether it has any affect on this rather more serious one.

joethephish avatar Sep 20 '16 16:09 joethephish

#62 definitely describes my experience!

jakewlandis avatar Sep 21 '16 01:09 jakewlandis

Unfortunately just faced this today after working on some code for a day. What I can say is that I made edits to the script, and resolved all compile-time errors (No Issues). However, knowing that the script was incomplete and I would definitely have run-time errors that will cause the app to crash, I CTRL+S ed and then went through the storyline to read through what was happening. After it crashed expectedly due to some run-time error in my Ink Script, I force-closed it using Mac's Force Quit function and put my computer to sleep and went about my evening.

I got home, restarted my computer to get into the swing of things and to start it fresh, and that was when I found the file to be completely wiped.

Hope this helps in the debugging process, and wish me luck as I'll go about starting again! ><

starsia avatar Jul 09 '23 19:07 starsia

Oh, dear. This literally just happened to me as well. Unfortunately, I'm not even sure how it happened. I had 2 Inky files open: both were stored in the same folder, but neither had references to each other (they were just standalone sample projects, so no includes were used). I made a change in one of the files, saved, then switched back to the other one. I then continued editing the second file until I decided to stop for a bit and exited Inky. At the very moment I quit, I noticed that the first document's window had gone blank in the background. Inky didn't ask me whether or not I wanted to save, and when I reopened the affected file, it was wiped clean. :(

The good news is that I wasn't working on a large-scale project, or much of a project at all, but I'd be lying if I didn't say that there was some content in that particular file that I was hoping to keep a hold of for a future (actual) project. Not to mention any kind of data loss is a bummer. Rip. 😔

Sorry this report probably isn't too helpful, but I just wanted to chime in that whatever is causing Inky to wipe files out of the blue seems to still be happening as of the latest build. I love Ink itself, but I have to be honest in that Inky leaves a lot to be desired. Is there any chance we could get an official VScode extension instead of having to rely on this (at times flaky) editor? I know there are a few third-party extensions out there, but they seem somewhat out-of-date. Anyway, here's hoping this bug gets fixed eventually! And lesson learned about using version control even for sample projects...

Phosfyr avatar Jul 12 '23 02:07 Phosfyr