gingko / client

Gingko Writer. Tree-based writing software, written in Elm.
https://gingkowriter.com
MIT License
361 stars 49 forks source link

Clarify Save Status #152

Closed AdrianoFerrari closed 5 years ago

AdrianoFerrari commented 5 years ago

Currently, "All Changes Saved" refers to saved to disk, in temporary Swap folder. Changes are saved to file after 15 minutes of inactivity, or on closing document. Need to clarify the save status of the file itself.

pecefix commented 5 years ago

"Changes saved" does not work for me at all (Version 2.4.0). Changes I made are visible as long as I do not close the file (often the Message "All changes saves" occurs, sometimes I made changes an there is still "unsaved changes" on the screen). But when I close and re-open the same file, changes are gone and I always get an old version. Am I the only one with this weird behaviour? And where can I find the temporary swap folder? Is there a chance that I can restore a file with all my changes?

AdrianoFerrari commented 5 years ago

That sounds pretty serious, @pecefix . Sorry about that. I'll dig into this. In the meantime, you can find backup folder here:

pecefix commented 5 years ago

Thank you. I checked %APPDATA%/Roaming/Gingko/backups/ . There are a lot of recent backups, but the files also contains old versions and not the most recent version before closing the app.
To save recent changes I have to use Export as (text). I just compared the text-file with the original gko files and they are different. It seems that the app forgets after some time (or some changes) to save the new content as the first few changes are saved.

katsumi27 commented 5 years ago

I have been having the exact same problem. It will save at first, but after some time it will no longer save even if it says it has saved.

The workaround I have been doing is actually exporting as JSON and then opening that file and overwriting the saved one.

AdrianoFerrari commented 5 years ago

I'm trying to reproduce this error so I can fix it. @katsumi27 when you say "after some time", roughly how long are you talking about? Seconds? Hours?

AdrianoFerrari commented 5 years ago

No need to respond, @katsumi27 . I figured out where the problem lies, and it seems to be limited to Windows. Working on a fix now.

AdrianoFerrari commented 5 years ago

I attempted a fix in v2.4.1.

I'd be very helpful @pecefix and @katsumi27, if you could let me know if it works as expected after auto-updating and restarting the app.

pecefix commented 5 years ago

Okay let's see. I tested it bit rough now, several times closing the app, moving and creating items; reloaded the file four times. With 2.4.1 I don't notice any losses yet, I'm sure that 2.4.0 would have had losses while practicing similar testing.

But with one file (A) I have new problem now: I neither can close the file nor quit the app. And I'm not able to EXPORT the file but I can SAVE AS. If I open another file (B) parallel to (A), everything works with file (B) (closing, quit, export). I had to kill the process (A) with the task manager. After opening the file (A) again, I was able to close it as usual.

And while roughly testing I got this error twice (but without losses at the end - I was able to save it anyway): 2019-05-03_17h10_08

And this is also interesting (filename =/ All changes saved) 2019-05-03_17h32_10, but the disappeared after the next editing of an item.

katsumi27 commented 5 years ago

Did some tests: the fix seems to be working so far.

Most often it used to stop saving if I left a card opened and moved away from the program for a few minutes. But also after several minutes (40+min) of it running, it would also stop saving.

I did my best to test both of these scenarios as I'm short on time today, and it seems to be working well!

(I did have to launch the update manually from the folder though. I believe it has done a few updates automatically in the last few months, but I've never noticed it happening. This time I exited and relaunched a few times and didn't see any changes so I went looking for it so I could test.)

pecefix commented 5 years ago

I worked today hours with the gko-file and I confirm, that the saved file contains all the data I have created, which for sure would have not the case with 2.4.0. I'm wondering, why the file-size of .gko is growing rapidly, while the json-file with the same content keeps really tiny?

katsumi27 commented 5 years ago

Did some tests: the fix seems to be working so far.

Most often it used to stop saving if I left a card opened and moved away from the program for a few minutes. But also after several minutes (40+min) of it running, it would also stop saving.

I did my best to test both of these scenarios as I'm short on time today, and it seems to be working well!

(I did have to launch the update manually from the folder though. I believe it has done a few updates automatically in the last few months, but I've never noticed it happening. This time I exited and relaunched a few times and didn't see any changes so I went looking for it so I could test.)

Just wanted to say that with this fix I was finally able to make some significant progress in a few projects of mine. Really grateful for Gingko!!

AdrianoFerrari commented 5 years ago

Thanks for the tests, and sorry again about the bug.

I'll keep this issue open, because I do still want to clarify what state of saving the app is in. At least three modes are involved:

  1. Saved to temporary storage
  2. ... and Saved to file
  3. ... and Saved a backup
AdrianoFerrari commented 5 years ago

An update : I'm almost ready to release a new version to address and close this issue, but I've been stuck for the last week by an error on the Windows build :confused: .

(for more details: issue is with building native dependencie "leveldown" on Travis CI linux machine, via electron-builder's "multi-platform build" configuration).

AdrianoFerrari commented 5 years ago

Fixed in v2.4.2.