Bug 134387 - command-line started EmergencySave "LibreOffice Document Recovery" dialog appears even when there is no document to recover
Summary: command-line started EmergencySave "LibreOffice Document Recovery" dialog app...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: lowest trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Document-Recovery
  Show dependency treegraph
 
Reported: 2020-06-29 11:02 UTC by Gerald Pfeifer
Modified: 2023-08-12 13:44 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of "empty" crash dialog (19.40 KB, image/png)
2020-06-29 11:02 UTC, Gerald Pfeifer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2020-06-29 11:02:09 UTC
Created attachment 162503 [details]
Screenshot of "empty" crash dialog

How to reproduce:

 1. Invoke LibreOffice via the command line specifying a document that
    makes LibreOffice crash.
 2. Observe how the "LibreOffice Document Recovery" dialog appears, even
    though no document has been nominally opened.
 3. In particular note how the "The following files will be recovered"
    list is empty.

I cannot reproduce this directly any longer, since the original issue (of
LibreOffice choking on a presentation) has been fixed.  In terms of pseudo
code, the patch probably should look something like the following:

 -     openDocumentRecoveryDialog();
 +     if ( globalstate.documentList.size() > 0 ) {
 +         openDocumentRecoveryDialog();
 +     }
Comment 1 Robert Großkopf 2020-07-14 06:43:07 UTC
Has nothing to do with Base, the database-component of LO. Have set the component to LibreOffice.
Comment 2 Xisco Faulí 2020-08-03 15:31:10 UTC
@Heiko, @Caolán, any opinion on this issue ?
Comment 3 Heiko Tietze 2020-08-03 15:55:20 UTC
Sure, would be nice to suppress the recovery dialog in case of no documents. However, IIRC there is an empty entry in the list, perhaps when the document wasn't explicitly saved.
Comment 4 Gerald Pfeifer 2020-08-03 16:05:59 UTC
(In reply to Heiko Tietze from comment #3)
> Sure, would be nice to suppress the recovery dialog in case of no documents.
> However, IIRC there is an empty entry in the list, perhaps when the document
> wasn't explicitly saved.

Yes, in my case LibreOffice crashed trying to open a certain document when
invoked from the command-line:

  libreoffice trouble.pptx

So indeed nothing was ever saved in that session (nor successfully opened).

When then invoking LibreOffice again the next time, the recovery dialog with
an empty list of documents appears.  That is what I suggest to avoid.
Comment 5 ksso 2020-11-03 20:34:06 UTC
indeed yes,  and besides, the recovery doesn't really works
Comment 6 Xisco Faulí 2021-11-23 11:15:10 UTC
Hello Gerald,
Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 7 Gerald Pfeifer 2022-03-01 09:33:20 UTC
(In reply to Xisco Faulí from comment #6)
> Hello Gerald,
> Could you please try to reproduce it with the latest version of LibreOffice
> from https://www.libreoffice.org/download/libreoffice-fresh/ ?
> I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' if the bug is still present in the latest version.

So far I could not reproduce which, alas, does not confirm the issue is
gone.

I just am lacking the prerequisite for step 1 of my original reproducer:

  "1. Invoke LibreOffice via the command line specifying a document that
   makes LibreOffice crash."

Do you have a document that makes LibreOffice (head) crash upon start-up?
Comment 8 Gerald Pfeifer 2022-04-22 20:13:36 UTC
"Thanks" to bug #148735 I can confirm this is still an issue. 

The dialog in this case does not appear on the next startup, rather
LibreOffice is shown in the same invocation, after the crash.


Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: e4243a140345a4bcd800217115b42667e277c6a3
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 9 Justin L 2023-08-10 13:25:56 UTC
I'm not sure this should "go away". It is the only indication of "why did LibreOffice quit/restart?". Suggest WONTFIX

What is happening here is that some kind of error (that doesn't affect the UI)  bAllowRecoveryAndSessionManagement, and so is triggering a doPrepareEmergencySave.

To avoid the dialog: svx/source/unodraw/recoveryui.cxx impl_doEmergencySave()
-    short nRet = xDialog->run();
+    short nRet = DLG_RET_OK; // no restart request
+    if (pCore->getURLListAccess().size())
+        nRet = xDialog->run();
+    return (nRet==DLG_RET_OK_AUTOLUNCH);
Comment 10 Justin L 2023-08-10 13:43:13 UTC
(In reply to Justin L from comment #9)
> I'm not sure this should "go away".
nRet could default to two possibilities:

-DLG_RET_OK: LibreOffice will just return to the command prompt, with no indication of why it failed to start.

-DLG_RET_OK_AUTOLAUNCH: it will restart to a start center (or perhaps continually restart if the crash is caused by something in the init process.)

I don't like either choice. I like the current dialog that informs the user that some kind of nasty error has occurred and waits for an ACK.
Comment 11 Gerald Pfeifer 2023-08-10 13:47:12 UTC
(In reply to Justin L from comment #10)
> I don't like either choice. I like the current dialog that informs the user
> that some kind of nasty error has occurred and waits for an ACK.

Could there be a different dialog, maybe just a simple message box,
in case there is not a single file to recover?


A dialog with a list labeled "The following files will be recovered"
which, alas is empty, is confusing for users. (Or the same dialog,
just saying "no documents available for recovery"?)
Comment 12 Justin L 2023-08-12 13:44:37 UTC
(In reply to Gerald Pfeifer from comment #11)
> A dialog with a list labeled "The following files will be recovered"
> which, alas is empty, is confusing for users.
I don't find it confusing at all. There was a crash, but no files will be recovered.

Plus, this apparently only occurs with command-line starts, so approximately nobody will encounter this. WONTFIX.