klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

Twine erased my project while editing a node inside of it! #571

Closed rubereaglenest closed 2 years ago

rubereaglenest commented 5 years ago

SPECS: Twine 2.3.2, for Windows 10, 64 Bits. Story Format: Chapbook, but the bug is independent of story format.

I was editing a node, and then PUF! An error message said: "The archive you are editing doesn't exist" (or something, I'm paraphrasing, I didn't get time to capture the error because I just was panicking)

I got out of twine, I entered again, and the story was not there.

I look up into the stories directory, the html was not there.

Who the hell knows how or why the archive disappeared, just in front of my very eyes!

thanks god I make backups by hand EVERY day.

and also I have a backup with a Git server, so, it is not lost. But damn!, this was a huge scare, and probably one of the worst bugs of Twine.

rubereaglenest commented 5 years ago

I managed to reproduce the error. I really don't know what is happening. I just started to add new choices in one node, and the error always shows up. Just, the file volatilizes. I have a screenshot now. Error ENOENT

rubereaglenest commented 5 years ago

Ok, the bug is independent of story format. Today, it happened again, just writing prose on a node, and I was using harlowe just to be safe of using a beta format.

If you guys, want my story to check and reproduce the bug, or need anything, just ask. You can reach me at twitter.

klembot commented 5 years ago

If you haven't already, could you try with 2.3.3?

jamjarae commented 4 years ago

I've had this happen 4 times today on Twine 2.3.5 using Chapbook 1.0.0. Could be because I have Twine open in two windows while I copy and paste from one story to another. The file disappears when editing not when pasting.

jamjarae commented 4 years ago

Just one window of Twine open and the file can delete itself and not re-save. Just watching the folder and moving a passage around the screen can cause this. Shouldn't this be overwriting the html file, not deleting and saving a new file?

jamjarae commented 4 years ago

I have it constantly backed up with dropbox, could that be causing the issue?

TheOverseer279 commented 4 years ago

I also have this problem, it doesn't seem to be linked to any antivirus program as the antivirus program notifies me if it removes or stops a program from doing something but it doesn't do that when the error appears. I am also using windows 10 with version 2.3.8 of twine and was using sugar cube 2.31.1 so it doesn't seem to be linked to a specific story format either. @klembot

klembot commented 4 years ago

These types of problems are unfortunately very difficult to track down. If there are specific steps that reliably cause the issue to happen, that would be very helpful (hence the needs repro tag).

TheOverseer279 commented 4 years ago

I don't know exactly how Twine saves stories but I assume it's like a small interval that it waits out then it saves and repeats that until you finish editing, though that problem doesn't repeat perfectly in time so either my assumption is wrong or for some reason some save intervals work fine while others randomly get that error. sadly there aren't really any steps that I know of that reproduces that error so I can't help you there.

klembot commented 4 years ago

Code that sends a message to save when changes are made (happens on every change): https://github.com/klembot/twinejs/blob/2.3-maintenance/src/data/file-system/index.js

Code that listens for that signal and saves to disk: https://github.com/klembot/twinejs/blob/2.3-maintenance/src/electron/story-file.js

jamjarae commented 4 years ago

I found pausing dropbox syncing stops the file from disappearing. My guess is the constant removing and saving after every key press gets missed occasionally by any software monitoring the folder and that software will delete the file if it thinks the file added to the folder is older then the remove it just processed.

klembot commented 2 years ago

This looks like a bug with Twine 2.3 or earlier, and because of that I'm closing it. Please re-open or create a new issue if you find this is still a problem in 2.4.