Bug 161570 - please redesign autosave feature
Summary: please redesign autosave feature
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: general (show other bugs)
Version: trunk-kde4
Platform: openSUSE Linux
: HI critical
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-03 19:42 UTC by Maciej Pilichowski
Modified: 2016-12-01 18:53 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to disable autosave by default (389 bytes, patch)
2012-02-19 17:57 UTC, Heikki Naski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Pilichowski 2008-05-03 19:42:06 UTC
Version:            (using KDE 3.5.9)
Installed from:    SuSE RPMs

Well, maybe I repeat my own comment from report about such feature but for Kate:

"
I would like to add my 2 cents by stressing the design of this feature. Commonly it is referred as autosave or autobackup. The first name is a bit misleading, editor should not automatically "save" the data, but just make a backup (automatically). So it there is a file: 
 a.txt 
 and I would edit it in Kate (autobackup set), Kate should create periodically backups 
 a.txt.backup (just an example) 
 but a.txt should remain intact until the user explicitly hit "save". 
 
 Sorry it this was obvious from the beginning but I thought I better comment this then post a wish "please change the behaviour..." :-)) 
"

In case of Kile the feature is already there and it was done as literally autosaving the data. This is wrong -- the document should be automatically saved (true) but not as the same file (see above). It is too easy to miss the fact that you quit Kile with unwanted changes to the file (for example).
Comment 1 Jorge Adriano 2009-12-17 02:42:56 UTC
This shouldn't be marked as critical.
Comment 2 Dominik Haumann 2011-04-06 14:24:24 UTC
Kate Part provides swap files in KDE >= 4.6. So if Kile crashes, you won't loose data. Is this a viable solution for you? The *.backup files would not really provide more here...
Comment 3 BartOtten 2011-10-11 23:57:03 UTC
,backup-files would really make a mess of document folders. And I agree with Jorge that this should not be marked as critical.
Comment 4 Maciej Pilichowski 2011-10-12 13:18:07 UTC
a) behaviour which leads to data loss IS critical (by definition, it is not mine, or yours opinion, it is just fact)

b) backup-files, or any other IMPLEMENTATION is just what is is -- implementation. I wrote about as suggestion, 

#2, Dominik, sorry, somehow I missed your post. Does it work in this way, that the file is "forked" -- so until user click "save" the original file is unaltered, and on the other hand all changes made to the already read content, are saved to the backup file.

So when computer crashes user would have AT LEAST two points of recovery -- original content and last auto-saved content.
Comment 5 Heikki Naski 2012-02-14 18:33:50 UTC
I verified that the requested behavior (swap files) is implemented in Kate (I understood that from Dominik's comment that it should therefore also work in Kile):

Open an empty file in Kate from terminal (kate empty.txt)
Write "before save" and a newline
Save the file (Ctrl-s)
Write "after save"
Kill kate (Ctrl-c)
The contents of the file are now "before save" and a newline
List the directory contents and note there's a file .empty.txt.kate-swp
Run Kate again and open the same file (kate empty.txt)
Note that Kate warns that the file was not closed properly and offers options to view changes and recover them
Click on Recover
The contents of the file are now:
before save
after save

Kate 3.6.5 KDE 4.6.5
Comment 6 Maciej Pilichowski 2012-02-15 07:29:10 UTC
Could you please follow this steps:
1. create new doc
2. type "foo"
3. save
4. set autosave to 1 minute
5. type more "bar"
6. wait 2 minutes
7. quit
8. check the file 

What is the outcome (content)?
Comment 7 Maciej Pilichowski 2012-02-15 07:31:38 UTC
PS. (8) or there is a question whether the content should be saved before quitting?
Comment 8 Heikki Naski 2012-02-16 21:04:13 UTC
@Maciej, I confirm that Kile does save the contents automatically using the
steps you defined. And I agree that it can be annoying. 

However, you can turn it off from the options and the swap files work
independent of autosaving. So you get the recovery behavior you wanted in the original description of this issue. 

Therefore I believe we can leave this issue as resolved?

If you think that autosave should be disabled by default in Kile, you should make a separate wishlist issue for that.
Comment 9 Maciej Pilichowski 2012-02-17 19:01:04 UTC
Thank you for the reply, well, my wish is for autosave which is not destructive (see original post).

Since, you said it is not implemented, I reopen it and then please take further actions appropriately -- either close it (wontfix) or keep it opened until fixed.

Please note, I am not your manager or something like this, I understand that implementing autosave dirty way is cheaper and faster, but has ugly turn, because it is treated equally as manual save. The ways to handle this by user are workarounds, not solutions, and you not as well as me, that forcing user to know and use them quickly become a mayhem to use any software.

So, the wish still stands, and I hope, for good of all users, we have it someday. But if it is not possible because time, health, etc. constraint, I understand. That's all I can say :-)
Comment 10 Heikki Naski 2012-02-19 16:18:09 UTC
Quoting Maciej:
> [...] my wish is for autosave which is not destructive
> (see original post).
>
> Since, you said it is not implemented, I reopen it and then please take further

Just to be clear, a crash recovery is implemented. It works by saving the contents of the edited file to a swap file, and if Kile crashes, you can recover all your changes from this swap file. There is no need to enable the autosave feature for this. The crash recovery is implemented in Kate Part, which means it works the same in all the software that uses it. Note that Kate, for instance, does not even have a destructive automatic save. It only has this crash recovery feature.

Therefore, a non-destructive autosave is implemented in Kile (if I understood your wish correctly).

I understand that our problem is just that the other feature, the destructive autosave, is on by default. Is this correct?

I definitely agree with you that an editor should not save automatically. But since some people seem to like it, I think that the feature is justified. However, I still think that it should not be on by default.

I suggest we create a new issue which clearly asks for just that behavior. This old issue has several problems which can cause it to not progress:
* The issue is old (developers skip old issues more often than new ones)
* It is long (with the discussion in the comments. again, developers do short ones more often than long ones)
* It has two items in it (feature request for crash recovery and a report about
  automatic saving being on by default)

Reports which have more than one item in them are hard to track and sometimes confusing, and the KDE recommends that there should only be one item per report.

There are votes on the issue which could be why you might not want to create a new issue for the "disable autosave by default" request. But we can't know which votes actually were for the "disabling autosave by default" and which votes were for the crash recovery implementation, so developers might disregard the votes anyway.
Comment 11 Maciej Pilichowski 2012-02-19 16:46:13 UTC
> Therefore, a non-destructive autosave is implemented in Kile (if I
> understood your wish correctly).

My wish was about not mixing manual save with automatic save (to make it really short). There should be no autosave but autobackup (see my original post).

> some people seem to like it

For the record, this is an overstatement, starting from my doubts if they really _like_ it (emotion) or _use_ it (action).

> It has two items in it (feature request for crash recovery and a report
> about automatic saving being on by default)

Where did you find those?

My report is about autosave which overwrites original file, which shouldn't do. That's all. Autosave should operate on its own file (a backup).

I cannot be more clear than I was in my original report, and opening new one, a duplicate, just get rid of the comments, is making more mess actually. If developers do not want to deal with old reports, I have no intention of tricking them this is the new one, if they don't see any merits in the report, so be it. I think it is way more fair.
Comment 12 Heikki Naski 2012-02-19 17:57:19 UTC
Created attachment 68932 [details]
Patch to disable autosave by default
Comment 13 Heikki Naski 2012-02-19 17:57:46 UTC
Ok. I confirm that this issue exists and therefore I'm changing its status to new.

It might help if the summary of this issue would be changed to "Disable autosave by default" or "Remove the autosave feature completely", depending on what you want.

To ease the maintainers' decision making process I tried to do a bit of research to find out if people like the autosave feature.

Here are messages on the mailing list about the feature:
http://osdir.com/ml/kde.devel.kile/2007-04/msg00052.html

Here's a list of bugzilla issues regarding autosave. People seem to be using it, or at least they think that it should work.
https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=autosav&product=kile&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=

There's a positive comment on the forums about the feature, but this doesn't necessarily mean that this user likes the autosave. It could be that he is merely happy to know that his work will not be lost if there's crash, and the crash recovery feature handles that:
"When I'm typing a document, Kile will autosave it for me. Great!"
http://sourceforge.net/projects/kile/forums/forum/292014/topic/1928411

A negative comment:
http://comments.gmane.org/gmane.comp.kde.devel.kile/1411

I'm attached a patch that turns autosave off by default. I tested the patch by compiling the 2.1.1-version.
Comment 14 Jorge Adriano 2012-02-19 18:20:41 UTC
Let me add a vote for "auto-save it with a different name". Honestly it's the only option that makes any sense. 

Sure plenty of people will say it's great that it automatically saves their file. But when would they need that? If there's a crash, you've got the .backup, and will be asked to restore it next time. If you forget to save before exiting, it will ask you to save. So when do you need it really? 

It only makes sense as a way to provide you a way to go a little back in time, but not much. But what we have here is an _additional backup_, aside from the one that keeps your last buffer in case of a crash. 

In fact it's easy to think of other useful additional backups, such as a copy of the document as it was in the very beginning of the session. And maybe more than one time interval, a backup for every 3 minutes and another for every 30 mins. Anyway my point is, these are automatic backups, and should be treated as such.
Comment 15 Maciej Pilichowski 2012-02-19 21:01:58 UTC
@Heikki

> It might help if the summary of this issue would be changed to "Disable
> autosave by default" or "Remove the autosave feature completely", depending
> on what you want.

I _wish_ none of that. My wish is -- do not overwrite original file when autosaving. Or -- introduce autobackup instead of autosave. Or -- provide safe autosave.

Which one is more informative?

I am not against autosave, I am pointing out that current design can lead to loss of data, and this is quite contrary to what you would like to have autosave for. Thus current autosave is dangerous and I wish for fixing it.

@Jorge,

Amen to that, only one thing:

"Sure plenty of people will say it's great that it automatically saves their
file. "

I believe that's because 100% of them:
a) don't know the internals or...
b) weren't bit by the design of autosave and didn't lose data yet
Comment 16 Michel Ludwig 2016-12-01 18:53:59 UTC
Kile's autosave feature has been removed in revision 56d0ead3433a3649aa82a915d3280d95e929be83 in favour of Kate's recovery mechanism