Bug 76992 - LibreOffice Pretends a document recovery is successful, where no AutoRecovery data is available
Summary: LibreOffice Pretends a document recovery is successful, where no AutoRecovery...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: AutoSave-AutoRecovery-Backup Document-Recovery
  Show dependency treegraph
 
Reported: 2014-04-03 11:26 UTC by Harald Koester
Modified: 2023-08-09 14:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koester 2014-04-03 11:26:26 UTC
Problem description: 

Steps to reproduce:
[1] Start LibreOffice and disable option “Load/Save > Save > Save AutoRecovery information. Then  OK.
[2] Create new text document and insert some text.
[3] Save document.
[4] Insert some more text.
[5] Force LibreOffice to close by
   (a) using the task manager (simulates freeze)
   or
   (b) switching off the power supply of your computer (simulates a blackout of the power supply)
Case (a): Ignore the save document dialogue. Just wait until you are asked to end LibreOffice. Click button to end LibreOffice. 
Case (b): Just reboot your system.
[6] Start LibreOffice again. The recovery dialogue is displayed. Hence no recovery information has been saved a recovery dialogue does not make sense at this point. Expected: Inform the user that LibreOffice has been closed unintentionally and that all data changes since the last user save  (step [4]) are lost. Furthermore the user should be advised to enable the option mentioned above in order to avoid data losses in future. And at the end the user should be asked if the last saved document should be opened. A second recovery dialogue, where the user is informed that a successful recovery has been performed is not necessary.

Furthermore I tested the recovery behaviour of LibreOffice in case of a LibreOffice crash. Therefore I used bug 75898. With this bug a complete recovery is possible. That means also the changes after the last user save (step [4]) are recovered. But I do not know if a complete recovery is possible in all LibreOffice crash cases. If not, in this cases the user should also be informed according the description in step [6].
              
Operating System: Windows 7
Version: 4.2.2.1 release
Comment 1 Buovjaga 2014-10-31 13:01:19 UTC
I confirm, set as enhancement and NEW.

Version: 4.4.0.0.alpha1+
Build ID: 56019dcb79475606952a954fe732a3109441ffec
TinderBox: Win-x86@39, Branch:master, Time: 2014-10-30_07:27:11
Comment 2 Harald Koester 2019-03-15 12:15:58 UTC
Checked issue again with version 6.1.2 (Win 10). The behaviour has not changed.
Comment 3 Nikolai Wüstemann 2022-12-11 11:16:25 UTC
The issue persists in v7.4.2.3.

There is a fundamental flaw in NOT having AutoRecovery activated with a fresh installation in the first place.
Comment 4 Stéphane Guillou (stragu) 2022-12-20 22:40:44 UTC
Also in recent master build on Linux:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ad387d5b984c6666906505d25685065f710ed55d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Ending / Killing the process brings up the Document Recovery dialog at next start, and the recovery is reported as "successful" even though only the most recent saved version is restored.
Comment 5 Stéphane Guillou (stragu) 2022-12-22 01:20:43 UTC
*** Bug 148438 has been marked as a duplicate of this bug. ***
Comment 6 Justin L 2023-07-15 23:25:39 UTC
I think this is probably another version of bug 57414.
IIUC, the solution to these bug reports would be that any document that is not modified should be excluded from the recovery process.
Comment 7 sdc.blanco 2023-08-02 12:19:38 UTC
(In reply to Justin L from comment #6)
> IIUC, the solution to these bug reports would be that any document that is
> not modified should be excluded from the recovery process.
A naive question:  Usually, when LO crashes (because of a bug in the software), and multiple documents are opened, where some of them are saved (i.e., in "not modified" state), then the recovery process (re)opens the saved files, as well as any files with recovery information. Will that behavior (of opening all open documents) stop with this change, so that only modified files will be recovered (while any "saved" (not modified) documents, which were open at the time of the crash) will not be opened?  (an unfortunate change imo).

Or does "excluded from the recovery process" mean that all open documents will be re-opened, while only those with recovery information will show up in the "recovery" window (where it is now possible to choose which ones to recover). (which seems like a helpful improvement).
Comment 8 Justin L 2023-08-09 13:32:49 UTC
(In reply to sdc.blanco from comment #7)
> (In reply to Justin L from comment #6)
> > IIUC, the solution to these bug reports would be that any document that is
> > not modified should be excluded from the recovery process.
> A naive question:  Usually, when LO crashes (because of a bug in the
> software), and multiple documents are opened, where some of them are saved
> (i.e., in "not modified" state), then the recovery process (re)opens the
> saved files, as well as any files with recovery information. Will that
> behavior (of opening all open documents) stop with this change,
Yes and no.
The simple answer is that "timed recovery files" will only be the modified ones. So in that case, "yes, opening all open documents will stop" as requested by bug 57414. (think temporary files, removable media or disconnected server files, etc.)

However, if the buggy crash leaves LO working enough to request an emergency restart, then "no, all open documents will be opened still". 

> Or does "excluded from the recovery process" mean that all open documents
> will be re-opened, while only those with recovery information will show up
> in the "recovery" window (where it is now possible to choose which ones to
> recover). (which seems like a helpful improvement).
No. For the same reason that the start center doesn't "hide" inaccessible files, this idea wouldn't work. Attempting to open inaccessible files can result in long timeouts, potential password requests for server access, etc.
Comment 9 Justin L 2023-08-09 14:02:41 UTC
There is so much stuff here, I'm not sure how to respond. Hopefully much of it is "better" in 24.2.

(In reply to Harald Koester from comment #0)
> Steps to reproduce:
> [1] Start LibreOffice and disable option “Load/Save > Save > Save
> AutoRecovery information. Then  OK.
> [2] Create new text document and insert some text.
> [3] Save document.
> [4] Insert some more text.
> [5] Force LibreOffice to close by
>    (a) using the task manager (simulates freeze)
>    or
>    (b) switching off the power supply of your computer (simulates a blackout
> of the power supply)
> Case (a): Ignore the save document dialogue. Just wait until you are asked
> to end LibreOffice. Click button to end LibreOffice. 
> Case (b): Just reboot your system.
> [6] Start LibreOffice again. The recovery dialogue is displayed.
Generally not true. With [1] disabled, only an EmergencySave or SessionSave could trigger a recovery on startup. Potentially [5a] or an OS-triggered reboot could trigger a SessionSave, but 5b should never allow [6].

> Expected: Inform the user that LibreOffice has been closed
> unintentionally and that all data changes since the last user save are lost.
Disagree. How can LO know that there were documents with unsaved changes at any arbitrary point in time? By turning [1] off, you are denying yourself the right to have any recovery benefits. In addition, bug 57414 is all about NOT showing a dialogs unless necessary, so lots of people would disagree with a simple warning dialog after every non-clean shutdown.

> Furthermore the user should be advised to enable the option
> mentioned above in order to avoid data losses in future.
Disagree. It defaults to on. If the user turns it off, they are responsible now.

> the user should be asked if the last saved document should be opened.
Disagree. That is what start center and open recent are for.

> A second recovery dialogue, where the user is informed that a successful
> recovery has been performed is not necessary.
Agree, and done for bug 145606.

> Furthermore I tested the recovery behaviour of LibreOffice in case of a
> LibreOffice crash. Therefore I used bug 75898. With this bug a complete
> recovery is possible and the changes in step [4] are recovered.
I assume that is an EmergencySave and automatic restart. Yes, in this case every open document should have been saved at the time of restart, so no changes should be lost. 

>  But I do not know if a complete recovery is possible in all crash cases.
Definitely not.
Comment 10 Justin L 2023-08-09 14:05:22 UTC
(In reply to Justin L from comment #9)
> There is so much stuff here, I'm not sure how to respond. Hopefully much of
> it is "better" in 24.2.
I think this could probably be closed as WORKSFORME.
Comment 11 Buovjaga 2023-08-09 14:06:41 UTC
Let's close. Thanks for all your work in the area, it is inspiring to see.