Bug 57414 - File Recovery: Don't save read-only and empty files for recovery
Summary: File Recovery: Don't save read-only and empty files for recovery
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Justin L
URL:
Whiteboard: target:24.2.0
Keywords:
: 85687 131734 148438 153137 (view as bug list)
Depends on:
Blocks: AutoSave-AutoRecovery-Backup Document-Recovery
  Show dependency treegraph
 
Reported: 2012-11-22 15:16 UTC by Stefan Knorr (astron)
Modified: 2024-04-22 07:36 UTC (History)
11 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 Stefan Knorr (astron) 2012-11-22 15:16:10 UTC
As documents that are opened read-only can not be modified anyway, we should turn off automatic saving for recovery for these documents.

Saving empty files for recovery is similarly useless and should be turned off too.
Comment 1 Joel Madero 2012-12-06 21:54:21 UTC
Does this help for recovery purposes? IE. is something saved in /tmp even if read only?
Comment 2 Joel Madero 2013-01-08 17:38:08 UTC
I'm going to assume that there is a reason for doing this. Especially for empty documents, that seems to make perfect sense. 

Marking as NEW and leaving it up to you guys (Developers) to decide how to implement :)

Marking as LOW as it's not going to add a lot for the end user, just a functional addition for "behind the scenes" stuff.
Comment 3 Stefan Knorr (astron) 2013-01-08 22:07:30 UTC
Sorry for my irresponsiveness.

First, a clarification: Read-only files can now (3.6+) be edited. Thus, among read-only files, the non-saving behaviour should only apply to unmodified read-only files (as received via email, etc.).

Rationale for this change:
When LibO crashes and users have accidentally or deliberately opened any of these types of documents, LibO will try to restore them – this is useless (obviously, since there is nothing to restore). It also adds to the many windows that restoration wizard tends to open, therefore can be confusing to users. Lastly, it is also rather disappointing when a file is restored and there is no content in it at all.


Marking medium (again?), because it does have user impact.
Comment 4 Kumāra 2013-03-10 09:32:24 UTC
I've sort of accepted (or tolerated with) this behaviour, but I must say that it makes LibO seem rather unpolished. In that sense too there is an impact. So, it would be a good idea to (carefully) resolve this.
Comment 5 Joel Madero 2013-05-29 21:28:19 UTC
Read only files cannot be edited - an example: just go to https://bugs.freedesktop.org/show_bug.cgi?id=37256, do not download but instead just directly open in LibreOffice version 4, this is technically a read only file now (as it hasn't been saved) but you cannot edit it. Multiple people complaining about this :-/

Just my two cents, as this is already NEW, moving on to more triaging :)
Comment 6 Kumāra 2017-09-18 04:22:01 UTC
(In reply to Stefan Knorr (astron) from comment #3)
> First, a clarification: Read-only files can now (3.6+) be edited. Thus,
> among read-only files, the non-saving behaviour should only apply to
> unmodified read-only files (as received via email, etc.).

Would it be better to say "Don't save doc recovery info for unmodified file"?
Comment 7 Stéphane Guillou (stragu) 2022-12-20 19:19:19 UTC
*** Bug 131734 has been marked as a duplicate of this bug. ***
Comment 8 Stéphane Guillou (stragu) 2022-12-22 01:15:16 UTC
*** Bug 85687 has been marked as a duplicate of this bug. ***
Comment 9 Stéphane Guillou (stragu) 2023-05-28 23:10:01 UTC
*** Bug 153137 has been marked as a duplicate of this bug. ***
Comment 10 Stéphane Guillou (stragu) 2023-05-28 23:14:52 UTC
*** Bug 137879 has been marked as a duplicate of this bug. ***
Comment 11 Eyal Rozenberg 2023-05-30 21:06:03 UTC
Bug 137879 asks for the same thing, but for temporary files - which may not be empty nor read-only. Should we unify the two bugs (expanding the scope of this one and marking bug 137879 as a dupe), or keep them separate?
Comment 12 Justin L 2023-07-13 21:35:04 UTC
Just to note that there are readonly docs that can be form-filled. So unless it is OS-marked as R/O, it gets rather complicated.
Comment 13 Stéphane Guillou (stragu) 2023-07-17 11:35:09 UTC
I can also get the document recovery dialog after killing OOo 3.3 with a read-only file opened, so marking as inherited.
Comment 14 Justin L 2023-07-17 14:37:20 UTC
proposed fix at https://gerrit.libreoffice.org/c/core/+/154490
Comment 15 Commit Notification 2023-08-01 01:11:13 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d16d86685afdf3d321cc282a39a65f38381b6eaa

tdf#57414 autorecovery: if no recovery doc, remove from RecoveryList

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2023-08-07 15:17:57 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/db9fa6da9d57853e0089a063ec372e11ce6046a9

related tdf#57414 autosave: try harder to know when !IsModified

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2023-08-07 15:41:04 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9e0f13b2c4d31537162434b5b932b265c62349e0

tdf#57414 autorecovery: don't always add every file to RecoveryList

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2023-08-07 15:42:07 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9fffac201136dc4f0a128171c17b0fd38836c043

tdf#57414 autorecovery: not in RecoveryList? always delete tmp files

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2023-08-07 15:44:09 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f5d6888bd1b945596684cb643118e0e07477d3fa

tdf#57414 autorecovery: don't store unmodified docs in RecoveryList

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2023-08-07 15:44:12 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/63bb760acc8aa50c352f3349e8adf3db381b4911

tdf#57414 autorecovery: avoid unnecessary storeToRecoveryFile

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2023-08-07 16:16:17 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ceeb48b33b374dfcd970d4fdd194ce0301bbb65a

tdf#57414 autorecovery: ignoreClosing during Emergency/SessionSave

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Justin L 2023-08-08 01:02:45 UTC
There are three types of Recovery. One is emergencySave (an exception in the program triggers a save-and-restart), another is SessionSave (when the OS shuts down), and the third is a timed autoRecovery.

In the case of EmergencySave and SessionSave, the intent is to recover the working environment, so ALL documents are attempted to be recovered. (The patches do a bit of work to ensure that happens better).

In the most general case - which OP is likely to referring to - the patches only try to recover modified documents that have a recovery file.

I think this bug is fixed.
Comment 23 Justin L 2023-08-09 14:05:38 UTC
*** Bug 148438 has been marked as a duplicate of this bug. ***