simsalabim/sisyphus

autoRelease issue/feature request.

Closed this issue · 3 comments

Not sure to put this one in issue or feature request?

Scenario:

  • When autoRelease is true, due some reason if User goes offline (out of wifi range).
  • User edits a form, makes some changes try submitting and fails (which is expected).
  • But the local storage is cleaned up with the changes made when offline. I would think workaround will be set autoRelease false; but it will keep consuming the web browser limit when different forms are accessed.

Possible solution:
Before doing autoRelease check navigator.onLine if true then continue else skip autoRelease code.

Can add a pull request if looks like a accepted solution?

Found a conversation which can help on this one..
http://stackoverflow.com/questions/3181080/how-to-detect-online-offline-event-cross-browser

@tbhavs cool stuff, gotta check it later ;)

There´s another situation I got... I had an error on the page that gets form´s data and when user gets back, the data is erased due to auto-release. This will happen when the file size exceeds the time and size limit I set. Of course, I can try to avoid it, but will not be easy in this network error example.

I couldn´t find instructions for manuallyReleaseData. How can I use it ? One solution would be to know the form reference that is saved on localStorage and manually clear it in the next page only If there´s no error. Is it possible ?

@simsalabim Forgot about it and stumbled upon this one just now... Closing it now