Bug 153137 - Document Recovery should not offer to recover read-only files
Summary: Document Recovery should not offer to recover read-only files
Status: RESOLVED DUPLICATE of bug 57414
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.3.2 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-21 09:10 UTC by JindrichP.
Modified: 2023-05-29 05:47 UTC (History)
1 user (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 JindrichP. 2023-01-21 09:10:26 UTC
Description:
I had opened 2 files: one in "edit" mode and second as "Read-only" mode.

After the LibreOffice Calc crash both files were successfully reopened using the "Document Recovery" however both were opened in "edit" mode.

Expected behavior is to open the "read-only" file in the same mode as it was before the crash.


Steps to Reproduce:
1. open first file for editing
2. open second file in "Read-only" mode
3. kill process soffice.bin or wait for spontaneous application crash
4. start Calc and recover both files using the Document Recovery
5. and see both files are in "edit" mode

Actual Results:
Actual results is that both files are recovered in "edit" mode.

Expected Results:
I would expect the second file that was in "read-only" mode before the crash to be again in "read-only" mode after file recovery.


Reproducible: Couldn't Reproduce


User Profile Reset: No

Additional Info:
Version: 7.4.3.2 (x64) / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 1 JindrichP. 2023-01-21 09:12:57 UTC
Correction: yes, I can reproduce the behavior.
Comment 2 Mike Kaganski 2023-01-21 09:18:14 UTC
Actually, recovery should simply not try to recover files that were open in read-only mode. Because it means there was no possible unsaved changes that need recovery.

Note that recovery does not mean "recover last session", but "recover unsaved changes after a crash".
Comment 3 Buovjaga 2023-03-20 10:16:31 UTC
I repro the recovery offering to recover the read-only file if there has also been a normal file at the time of crash, but it is opened in read-only mode. However, per Mike's suggestion it should not be on offer at all.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_FI); UI: en-US
Calc: threaded
Comment 4 ady 2023-03-20 11:06:02 UTC
(In reply to Mike Kaganski from comment #2)
> Actually, recovery should simply not try to recover files that were open in
> read-only mode. Because it means there was no possible unsaved changes that
> need recovery.

What happens if a user initially opens in read-only mode but then activates edition? The file was originally opened as read-only, but it is editable by the time a crash happens. Should recovery be attempted on such file?
Comment 5 Stéphane Guillou (stragu) 2023-05-28 23:10:01 UTC

*** This bug has been marked as a duplicate of bug 57414 ***
Comment 6 Mike Kaganski 2023-05-29 05:47:28 UTC
(In reply to ady from comment #4)
> (In reply to Mike Kaganski from comment #2)
> > recovery should simply not try to recover files that were open in
> > read-only mode. Because it means there was no possible unsaved changes that
> > need recovery.
> 
> What happens if a user initially opens in read-only mode but then activates
> edition? The file was originally opened as read-only, but it is editable by
> the time a crash happens. Should recovery be attempted on such file?

Not "files that had been *opened* in read-only mode", but "files that were in read-only mode at the moment of crash". Basically - the fact of becoming read-only (even from an initially editable state) should remove the file from the set of files tracked for recovery.