Opened 6 years ago

Last modified 3 years ago

#105 new enhancement

recover files when padre has crashed

Reported by: jquelin Owned by:
Priority: critical Milestone:
Component: editor Version: 0.15
Keywords: Cc:

Description

when padre crashes or is killed, everything is lost:

  • list of opened files
  • unsaved changes in those files

padre should allow to recover files when it has crashed / killed.

Change History (9)

comment:2 Changed 4 years ago by zenogantner

  • Priority changed from major to critical

comment:3 Changed 4 years ago by Sewi

Mail copied:
package Padre::Autosave;
use strict;
use warnings;

=head1 NAME

Padre::Autosave - autosave and recovery mechanizm for Padre

=head1 The autosave plan

I'd like to provide autosave with some history and recovery service.

This plan is not Padre specific.

An sqlite database will be used for this but theoretically
any database could be used. Event simple filesystem.

Basically we provide a versioned filesystem here with
autocleanup and metadata.

Besides the content of the file we need to save some meta data:

  • path to the file will be the unique identifyer
  • timestamp
  • type of save (initial, autosave, usersave, external)

When opening a file for the first time it is saved in the database.(initial)
Every N seconds files that are not yet saved are autosaved in the
database. (autosave)
Evey time a file is saved it is also saved to the database. (usersave)
Before reloading a file we autosave it. (autosave)
Every time we notice that a file was changed on the disk if the user decides
to overwrite it we also save the (external) changed file.

Before autosaving a file we make sure it has not changed since the
last autosave.

In order to make sure the database does not get too big we setup
a cleaning mechanizm that is executed once in a while.
There might be several options but for now:
1) Every entry older than N days will be deleted.

Based on the database we'll be able to provide the user recovery in
case of crash or accidental overwrite.

What do you think?

Gabor

comment:4 Changed 4 years ago by Sewi

A sqlite database might not be a good choice because it could become corrupt on Padre crash.

comment:5 Changed 3 years ago by Sewi

Addition: VCS plugins should be able to clear the history of a file if it has been successfully committed, maybe as a config option.

comment:6 Changed 3 years ago by Sewi

List of open files is retained as session "padre_last".

comment:7 Changed 3 years ago by Sewi

First basic implementation in r15201

comment:8 Changed 3 years ago by Sewi

Feature is broken and not writing backup files in r15311. Discovered after loosing work due to a Padre crash :-(

Last edited 3 years ago by Sewi (previous) (diff)

comment:9 Changed 3 years ago by Sewi

working again in r15376

Note: See TracTickets for help on using tickets.