Page 1 of 1

Data loss after sleep wakeup

Posted: Thu Oct 15, 2020 2:02 pm
by capocasa
Hi!

I've been having a bit of a data loss issue where I click save, the text I wrote was not saved, but the windows was still closed. This caused a bit swearing.

I think what's happening is that after waking my computer up, login session may no longer be valid, and save fails. However, this happens silently. Then, when I go back to open up my document, it's just not there.

I have too proposed solutions:

(1) Do not close unless absolutely sure that data was saved, by some kind of special confirmation code (perhaps a cache could deliver a 200 even though data was not saved, just as an example) and then do not close window unless saved

(2) Use localstorage as a backup client-side autosave- for starters, it would be enough just to be able to go through recent changes and perhaps find your text to copy and paste, nothing really fancy required there- just store the data in an extra place as a failsafe. This should probably be done all the time rather than just upon clicking save.

Preferably both. Bludit is so nice because it's so relaxing to type in, but of course potential data loss has a way of making you nervous.

Existing autosaves seem to silently fail as well in this condition- this should at least display a warning. So, in summary, it would appear that saving is insufficiently robust.

Re: Data loss after sleep wakeup

Posted: Thu Oct 15, 2020 10:24 pm
by Edi
Two solutions for the problem:

1) Use the plugin Heartbeat:

https://plugins.bludit.com/plugin/heartbeat

2) Use an addon for your browser like Form History Control (II) for Firefox.

Re: Data loss after sleep wakeup

Posted: Sun Oct 18, 2020 9:15 pm
by capocasa
Thank you for your reply! Will do both.

I would like to point out that I think avoiding data loss during edge case conditions would make a great candidate for a core feature.

Edit: The best way to do it I am aware of is to both alert when saving does not work and autosave on keypress debounced by 3-5 seconds. (quietly autosave after 3-5 seconds of not typing- "debounce" can be found as a feature in JS libs).

Re: Data loss after sleep wakeup

Posted: Tue Oct 20, 2020 7:31 pm
by Edi
capocasa wrote: Sun Oct 18, 2020 9:15 pm I would like to point out that I think avoiding data loss during edge case conditions would make a great candidate for a core feature.
You can post this as feature request on the GitHub tracker of Bludit:

https://github.com/bludit/bludit/issues