jEdit Community - Resources for users of the jEdit Text Editor
Catastrophic data loss due to jedit silently failing to autosave
Submitted by andreweans on Tuesday, 7 August, 2007 - 04:39
I rely on autosave. I ordinarily don't manually save my text files in jedit at all, until I need to open those files in other programs, since jedit automatically saves my changes. If jedit or my computer crashes, it's no problem, since when I restart jedit, it automatically finds the autosave files and offers to load them.

However, this safety feature recently failed catastrophically. I'd had jedit running for a couple weeks, and had made many changes to some files. Then my computer crashed, and when I restarted it and started jedit back up, I discovered that one of the autosave files, for a file to which which I had been making many changes every day, was empty! I lost a lot of irreplaceable data as a result.

I investigated, and found the problem. I had pasted some text which included an umlaut letter into the file, and jedit couldn't save it using the particular encoding which I had selected (windows-1251). As a result, it wrote a blank autosave file, and from then on, all of the text which I entered was stored only in memory, which was a disaster waiting to happen. I confirmed that this was the problem by creating a new file, pasting the offending letter, and trying to save it; I got this error:

I/O Error
c:\Users\Andrew\Documents\test.txt:
The following I/O operation could not be completed:
Cannot save: java.io.CharConversionException: Failed to encode the character
'ä' (U+E4) at column 1 in line 5 with the encoding "windows-1251".

It's true that that letter can't be encoded in that encoding. However, silently failing to autosave the file is a major fault of jedit. Furthermore, when I paste the offending letter into the file and then wait for the autosave, jedit writes "Input/output complete" in the status bar as usual, making me believe that the autosave was successful!

Automatically switching the autosave encoding to unicode (and notifying me of this fact) would be one solution to the problem. Another would be simply to display an error message alerting me to the fact that the autosave in my chosen encoding failed. But silently failing is absolutely the wrong thing to do.

A text editor's absolute highest priority, with no exceptions, is: never lose (or corrupt) the user's data. Sorry for ranting, but this is a bug which should not be allowed to remain.
It is present in both pre9 and pre10.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
try the mailing list.
by elberry on Wed, 08/08/2007 - 20:42
Hi,
I'm sorry I don't have a solution for you, but I noticed you've posted a few times recently without any responses. You might want to try the mailing list as I know a lot of the jEdit developers watch that pretty closely. There should be a link for the mailing lists in the right hand column.

Also, I know you didn't want to get a source forge account, but you might really considering doing so. Any bugs created there appear in the developers mailing list, so you've got a really good chance one of them will see it and know how to fix it.

SF is usually really good about getting login stuff to you quickly, and you shouldn't have to wait long at all.

Again, sorry I don't have a solution for you.

Learn from the past. Live in the present. Plan for the future.
User login
Browse archives
« March 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82339
Context Free Art (*.cfdg)   0.31   46046
JBuilder scheme   .001   18487
BBEdit scheme   1.0   18108
ColdFusion scheme   1.0   18016
R Edit Mode - extensive version   0.1   17465
Advanced HTML edit mode   1.0   16198
Matlab Edit Mode   1.0   16060
jEdit XP icons   1.0   15221
XP icons for jEdit   1.1   14285