Bug 128048 - When the app is about to be terminated by the system, it should perhaps save the current document
Summary: When the app is about to be terminated by the system, it should perhaps save ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: iOS Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-09 12:08 UTC by How can I remove my account?
Modified: 2023-09-09 07: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 How can I remove my account? 2019-10-09 12:08:24 UTC
Description:
If you have a document open, you have done some edits, and then switch to other apps for a while, and those apps require lots of system resources, the system will (hopefully) notify the Collabora Office app that it will be terminated (and after that terminate it with an uncatchable signal). This invokes the applicationWillTerminate: method of the UIApplicationDelegate. That will (now, after fixing tdf#126974) just cause the app to exit.

What it *should* do is probably cause the current open document, if any, to be saved in an orderly fashion, and only then exit. On the other hand, as the app has a separate "Save" button, and a "File > Save" menu entry, perhaps the intended workflow is not one where the document is saved automatically, but only on user request?

On the other hand, the app does auto-save changes to the document at regular intervals already, if I understand correctly, so doing an auto-save right before the system decides to kill the app would not be that different.

(Actually, this is IMHO self-contradictory. The old-fashioned desktop editor paradigm where an open document is saved only when explicitly requested is mixed with a more modern paradigm where the document being edited is automatically saved, ideally constantly (for which our time-based auto-save is a substitute), and no explicit saving necessary of even offered. The app has both automatic saving *and* explicit saving...)

Steps to Reproduce:
.

Actual Results:
.

Expected Results:
.


Reproducible: Always


User Profile Reset: No



Additional Info:
.
Comment 1 How can I remove my account? 2019-10-09 12:08:56 UTC
Nicolas, what do you think?
Comment 2 How can I remove my account? 2019-10-09 12:19:29 UTC
(Note that doing something in applicationWillTerminate: is not 100% safe, though; I read that there are situations where the system will kill the app right away with SIGKILL without causing that method to be called first.)
Comment 3 Nicolas Christener 2019-10-09 12:41:59 UTC
I often run into out-of-memory situations on my Android phone and think it's quite a common situation on phones/tablets. I therefore suspect, that saving the document when the app gets stopped/killed by the system is the right thing to do. 

Maybe we could even get rid of the "save" button/menu entry and do the following things:
* do an explicit save when using the back button "<"
* auto save every 30s (or what ever it is at the moment)
* save when the app gets stopped/killed by the user or system (kill the app)

Pages on iOS doesn't have a save button as far as I can tell.

MS Word on iOS does "Auto save" per default and the user can change it to manual save.
Comment 4 How can I remove my account? 2019-10-09 13:04:31 UTC
Do you think it is possible currently that some user might think/act like this:

"Oh, so there is an explicit save button, and File > Save, that means the document is not saved unless I tell it too. Good, then I can do some radical change just to check something, I won't save it... [proceeds to destroy most of their document] [document gets auto-saved] [switches to another app] [Collabora Office app is killed by system] [starts it again and opens the document] [notices the disaster] But I didn't save it!!! [runs away screaming]"

(That is after all how I often work in desktop LO, and old-fashioned editors. I know that nothing is saved unless I want, so I can experiment freely.)

--tml
Comment 5 Nicolas Christener 2019-10-09 14:22:13 UTC
Hard to say if this scenario happens.

But I believe, that explicit and implicit saving is not an ideal mix (however I'm by far not a UX/UI expert).

Looking at how tools in the Apple space tend to work I come to the conclusion, that user should not need to save manually. This is also documented here:

https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/file-handling/

  "In general, don’t make people explicitly save files. Instead, save
   changes automatically at regular intervals, when opening and closing
   files, and when switching to another app."

If it's not a huge effort I think we could also follow this pattern and remove the explicit save button / menu entry.

Of course this "auto save strategy" will not allow the scenario you mentioned anymore. But people will probably learn (maybe the hard way) quite fast, that they need to make a copy first if they want to experiment freely.

Does this help?
Comment 6 How can I remove my account? 2019-10-09 14:34:26 UTC
Yes, thanks, that matches my own thoughts.
Comment 7 Xisco Faulí 2020-01-13 14:33:23 UTC
Moving to NEW as agreed in the ESC meeting
Comment 8 QA Administrators 2022-01-13 03:41:55 UTC Comment hidden (obsolete, spam)
Comment 9 Justin L 2023-09-08 11:58:46 UTC
Ideally this would trigger an AutoRecovery SessionSave. (AFAICS, this is only triggered by some legacy X11 code - perhaps in VCL=gen.) Various bug reports request similar responses for GTK/KDE/Windows.

I think Tor's comment 4 is accurate. LO has all the plumbing to do an ODF recovery save in the user's backup folder, and restore on app-start. So that just needs to be wired into the applicationWillTerminate.