richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Warn if document is not saved when closing - Data loss

Open internethering opened this issue 1 year ago • 12 comments
trafficstars

Describe the bug If, for whatever reason, the document is not saved automatically when editing, the modified content is irrevocably lost after closing the tab or document.

Expected behavior If the document has not yet been saved, a pop-up message should warn you when closing that it still needs to be saved.

Client details:

  • OS: Windows/Linux
  • Browser: Firefox
  • Version: 120.0.1
  • Device: desktop

Server details

Operating system: Gentoo Linux

Web server: Apache 2.4.57

Database: MariaDB 10.11.5

PHP version: 8.1.26

Nextcloud version: 28.0.1

Version of the richdocuments app 8.3.0

Version of Collabora Online 23.5.604

internethering avatar Dec 22 '23 12:12 internethering

Did you encounter any data loss? Would be good to check the Collabora logs then. In general this should not be a problem with Collabora as the file state is always managed on the server so even if the browser window is killed the changes are persisted on the server.

juliusknorr avatar Dec 22 '23 12:12 juliusknorr

Did you encounter any data loss?

yes, a filled document was empty.

the changes are persisted on the server.

in this case not and It would be nice to popup a message: not saved

internethering avatar Jan 10 '24 19:01 internethering

In that case it would be interesting to see any logged errors still. Even if the failure occurs once the document should still be on the Collabora server and available to open again with the content i think.

juliusknorr avatar Jan 10 '24 19:01 juliusknorr

FYI @pedropintosilva as the autosaving and a possible manual save blocking dialog is probably something more on the online side, though I'd rather prefer to fix the root cause instead of having a blocking operation that could still lead to failures on saving.

juliusknorr avatar Jan 10 '24 19:01 juliusknorr

Thanks @internethering for testing and taking the time to report. This is very valuable.

Yes I agree @juliushaertl . @internethering are you able to gather those logs?

pedropintosilva avatar Jan 10 '24 19:01 pedropintosilva

@internethering, thanks for your report.

Describe the bug If, for whatever reason, the document is not saved automatically when editing, the modified content is irrevocably lost after closing the tab or document.

The document is always automatically saved upon closing/unloading the document. Of course there is no expectation that the user must be there and invoke the save command for the server to save; this is done automatically, in the background.

If, for whatever reason, saving and uploading to storage cannot be accomplished, error logs will clearly indicate data-loss.

As a last-resort, there is a feature to quarantine documents that aren't uploaded to storage. This needs enabling from the config, and the files are only accessible by an admin on the server, but the feature is there as a last resort.

Indeed, if you open a text document, make a change and close the browser without saving, the document should still be saved and no data loss should occur.

Expected behavior If the document has not yet been saved, a pop-up message should warn you when closing that it still needs to be saved.

The pop-up message will not be very helpful, I'm afraid. For one, because the user can close the browser and we cannot stop them.

It would be very interesting to have steps to reproduce, if indeed you have found a reproducible data-loss case. Similarly, would be very helpful to get trace-level logs from coolwsd, to see exactly what is happening.

Thank you.

Ashod avatar Jan 11 '24 23:01 Ashod

Hmmm. I'm having trouble with not saving unless manually saving, too. Will see if I can reproduce reliably.

artfulrobot avatar Feb 01 '24 07:02 artfulrobot

  1. Create new document (optional, can use existing)
  2. Open it
  3. put in some text
  4. close it with the × in the top right
  5. open it.
  6. document is blank!

What's odd is that if I open the document in a 2nd user on a 2nd browser at step 2, then on step 3 I get the collaborative experience; each user can see what the other writes. Yet when it's closed - without saving - data seems lost.

nextcloud-bug.webm

I will look for any logs.

artfulrobot avatar Feb 01 '24 07:02 artfulrobot

Yes, this is definitely something that should not happen. The Collabora server logs would be very helpful in that case.

juliusknorr avatar Feb 01 '24 08:02 juliusknorr

There's nothing in the nextcloud logs. Some stuff about can't find a OCA\Circles\CirclesManager class, but doesn't look relevant.

I'm using "CODE" - where would I find the server logs for that?

artfulrobot avatar Feb 01 '24 08:02 artfulrobot

By version of Online, that should not be CODE but Built-in CODE Server and that issue is https://github.com/CollaboraOnline/richdocumentscode/issues/238.

timur-g avatar Feb 01 '24 08:02 timur-g

Could this not be related to #238?

joho1968 avatar Jun 05 '24 12:06 joho1968