[dokuwiki] Re: adding autobackup saving

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 06 Mar 2006 21:18:56 +0000

Andreas Gohr wrote:

Hi *!

I'm just thinking about adding the gmail style autobackup thingy I
talked about a few weeks ago. Short reminder: when a logged in user
edits a page, her work is saved in the background automatically every
minute. If her browser crashes or something else happens she can later
return to the last autosaved state of a document.

Adding the background save was simple. Just a few lines more to the
lockrefresh code.

The complicated part is the workflow of continuing the lost edit
session. I'm not sure how to integrate this best. Here are some
questions bothering me:

1) I currently only save one backup per user. Is this a good idea?

Probably not. Multiple open browser windows would destroy overwrite
each others backup file.
I think one backup per user per page would be necessary.
2) how and when to notify the user about her dangling backup files?

A message at the top could give the user a message about unfinished
backups on all pages. (this could be technically the most expensive

The message could be displayed only when she visits the page the draft
is for. (easy)

We could display a message on pressing the edit of the affected page
button only. (somewhat more easy because we this anyway)
If the user attempts to edit the same page again, ask them if they wish to user their backup.
Maybe can also have a page that shows up when they next visit the wiki - a list of pages for which there
are valid backups. They can choose to carry on editing each one in turn or delete them or ignore them.
3) I always save the whole document in the backup (this is needed for
continuing the edit session) When the user continues the backed up
document. Should the whole doc be loaded or the section edited only?

This is just a decision of taste, technically both things are fine.
Which ever is faster. Could get javascript to do a diff?
4) should we add some cleanup mechanism for old backups? When to delete
a backup file?

if a newer document revision exists?
not if newer document created by different user. Would need a mechanism to allow user to choose between backup and more recent version. Ability to apply a diff could be useful here.
if the newer document revision is X days older than the backup?
I'm not sure waht you mean, how can new revision be older?
If backup is X days old when newer revision is created, then delete backup. Yes. Let X be a config variable.
if the backup is older than X days?
Yes. Again X could be a config value.
I'd like to get your input on these things. I want to keep this feature
as simple as possible please keep this in mind when making suggestions.
Maybe forget the diff thing then :-)
DokuWiki mailing list - more info at

Other related posts: