Jump to content

Please don't clear autosave on form submit


TSP

Recommended Posts

From this bug report: http://community.invisionpower.com/4bugtrack/localstorage-post-stripped-prematurely-r1920/

The issue is that when the board goes offline, I lose my internet access without noticing or probably anything that causes the form submit to go wrong; you'll lose the post. Because the localStorage / autosave data is cleared from the editor on post submit, so the post will be gone.

This have happened to me twice for the past few days. The first time was when the board was taken offline at some point, the form submitted but I was just met with the offline board message. So I had to write the post again. The second time was today, I'm currently on a train with an unstable internet connection so when I posted a new bug to the bug tracker, it didn't go trough the first time, I just got the message in the browser that I had no internet connection. I tried to just keep the tab open and refresh it later, in the hopes that the post data would submit again, but that didn't help, I was just taken back to an empty form. 

The autosave is a wonderful feature and a huge improvement from IPS 3.X, I love it in all the cases it has saved me. It works much better than previous versions for me. But that also heightens my expectations to it, so when it doesn't save me, then it's even a bigger disappointment than when something of the like happened in 3.X. It makes perfect sense to me it would also preserve it when something goes wrong with the submit. Up until just a few days ago, I've removed my tendency to copy the post before submitting, because the system made me trust it, now I would have to work that habit in again. The system doesn't really work as it should if I still have to copy my post before submit on 10/10 posts, just because it fails 1/30 of the times. 

Both @bfarber and @Mark stated they think this is challenging to do something about, I'm not sure what sort of implementation solutions, they've considered. But I hope we can be able to work this out together. 

​The most obvious suggestion is to clear the autosave only when the reply have been confirmed as received by the database. As suggested by @teraßyte, the submit and confirmation could be handled by ajax, as it does for most replies either way. If the ajax submit is not done or it fails, then the localStorage would NOT be cleared. 

The other suggestion wouldn't solve the problem if I lose my internet access, but if you could at least display the un-submitted contents from the post request on the offline-page, so it could be manually copied from the offline page or any other error page that could happen. 

Ultimately though, I'll much rather have posts that have been submitted and not cleared from localStorage, rather than having non-published posts be gone. :/

Link to comment
Share on other sites

Well said. I can think of many ways to solve this problem and I hope the developers give it some more thought and fix this before IPS4 release. I posted my "naive" idea of how to implement a fix in the original bug report. Basically, the JS needs to defer clearing localStorage for as long as it can and only delete this data when it is absolutely sure that the text made it into the database. 

Link to comment
Share on other sites

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...