[RFC] Autosave

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
lothario
Registered User
Posts: 4
Joined: Wed Oct 20, 2010 12:59 pm

[RFC] Autosave

Post by lothario » Fri Oct 29, 2010 9:59 am

Motivation
When you are writing long replies to forum topics, there is nothing worse than experiencing an error on submission, leaving no (obvious) way of retrieving it again. Solutions to this, for me, have been copying the text to Notepad (or just the clipboard), before submitting. This is not a good solution in my opinion.

Proposal
Create an autosave feature, that after a set time saves the currently entered data into a temporary database, which is then deleted on succesful submission. If the submission goes bad, the user is prompted with an option to restore the autosaved data.

The autosave feature would probably only work for users with javascript enabled.

Nelsaidi
Registered User
Posts: 122
Joined: Tue Nov 11, 2008 5:44 pm

Re: [RFC] Autosave

Post by Nelsaidi » Fri Oct 29, 2010 7:45 pm

It would put an immense load on the database and the server, it is better suited as a mod for boards who need it and have the computing power to serve it.

lothario
Registered User
Posts: 4
Joined: Wed Oct 20, 2010 12:59 pm

Re: [RFC] Autosave

Post by lothario » Fri Oct 29, 2010 10:33 pm

Nelsaidi wrote:It would put an immense load on the database and the server, it is better suited as a mod for boards who need it and have the computing power to serve it.
What's the difference between the server saving the post and the user pressing submit and saving the post? It wouldn't be any different really. If it's done every 5 minutes I can't see why it would be a load.

User avatar
Sierron
Registered User
Posts: 62
Joined: Wed Aug 25, 2010 11:41 am
Contact:

Re: [RFC] Autosave

Post by Sierron » Sat Oct 30, 2010 12:56 pm

If 10 users post some content and writing some big text, you don't have 10 saves to database, but 20 for 10 mins.

30 users + 10 minutes = 60 saves to database
50 users + 10 minutes = 100 saves to database

The database will be written more frequently. While perhaps some small post are made at the same time.

lothario
Registered User
Posts: 4
Joined: Wed Oct 20, 2010 12:59 pm

Re: [RFC] Autosave

Post by lothario » Sat Oct 30, 2010 5:04 pm

Sierron wrote:If 10 users post some content and writing some big text, you don't have 10 saves to database, but 20 for 10 mins.

30 users + 10 minutes = 60 saves to database
50 users + 10 minutes = 100 saves to database

The database will be written more frequently. While perhaps some small post are made at the same time.
What about a client solution then, save it as a cookie or a session file?

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC] Autosave

Post by igorw » Sat Oct 30, 2010 6:16 pm

I was about to say, something like this should probably be client-side. There are a few new "HTML5" client side persistence APIs that could be used for this (please don't bloat the poor cookies). But any decent browser supports the back button.

DrStrangelove
Registered User
Posts: 13
Joined: Thu Jul 01, 2010 3:33 pm

Re: [RFC] Autosave

Post by DrStrangelove » Sun Oct 31, 2010 4:11 am

caching a post client side sounds like the way to go but do you have any sources on that?
were you thinking of something like javascript+flat file?

i know firefox etc. stores post data, but I wouldn't call it reliable, on the contrary.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1799
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC] Autosave

Post by DavidIQ » Sun Oct 31, 2010 4:26 am

It could still be a round-trip to the database I think through an AJAX call. Wouldn't be any more heavy on the database than actually posting I think. The AutoSave would only be triggered after a certain amount of text has been changed as well as some specified amount of time has passed. This could turn fairly complex though when it comes time to retrieve the actual post(s). But for that maybe a list of auto-saved posts would suffice. Then the question becomes how long do you want to store these automatically saved "ghost" posts? This could get fairly complex in a heartbeat...
Image

DrStrangelove
Registered User
Posts: 13
Joined: Thu Jul 01, 2010 3:33 pm

Re: [RFC] Autosave

Post by DrStrangelove » Sun Oct 31, 2010 4:50 am

does it have to be proper? autosave is a last-resort feature to save the contents of a long post for a short amount of time, there's no need to involve server side at all IMO, and that keeps things simple as they ought to be.

if javascript stores the post in a local file named with session id, topic id and post id, it should be rather quick to do a check to see if there's autosaved content for the post in question. if there is, then a small dialogue can be inserted with js+dom. if the post disappeared altogether... perhaps a check+dialogue should be done in the topic screen?

recommend scrambling the locally stored posts btw.

it should work in theory. am i missing something here?

Nelsaidi
Registered User
Posts: 122
Joined: Tue Nov 11, 2008 5:44 pm

Re: [RFC] Autosave

Post by Nelsaidi » Sun Oct 31, 2010 11:43 am

I remember a post about using local storage - RFC somewhere, had some good points about autosaving, how it would work, downsides, etc etc.

An outcome of that I remember was that if the post didnt submit due to server error, chances are it wouldnt have saved a draft either.

My reasoning for saying database load would increase alot is because with the same actvitiy/forum users/posts, you are adding alot to it. Lets say everyone who types a post for more than two minutes (quality not qunatity, so tbh X characters isnt better than a time frame) - their post gets saved, and likewise until they submit. Then posts are deleted, ghost drafts are stored in the database, purged, etc, etc - The way I see it is that it isnt really ideal for shared hosting.

HTML5's Local Storage on the other hand is fast, drafts and multiple drafts of a post can be stored indefinitely and there's no server side constraints and is supported by the latest versions of all major browsers (http://www.findmebyip.com/litmus/) , with regards to unsupported yet widely used ie6 - http://support.microsoft.com/gp/lifesupsps , could potentially be unsupported by microsoft come 3.2, but imo you cant compromise based on what IE6 does and does not support, especially since this only enhances user experience and in no way prevents the user from using the board.

Post Reply