flathub / org.libreoffice.LibreOffice

https://flathub.org/apps/details/org.libreoffice.LibreOffice
29 stars 18 forks source link

When trying to open a document from another sandboxed flatpak application (such as fsearch), LibreOffice always claims there is a lockfile from "Unknown User" forcing read-only status #203

Open nekohayo opened 1 year ago

nekohayo commented 1 year ago

To reproduce, use @cboxdoerfer's FSearch app from Flathub and, after having configured it to index your documents folder, search for ".ods" or ".odt" (or any search result that will return LibreOffice files) and then click (our double-click, depending on your settings) on the filename in the relevant row (in the Name column). You will get this error dialog:

Screenshot from 2022-12-02 18-52-22

...but this is an incorrect assertion, as the file in question does not have a hidden LibreOffice lockfile present (and the "Unknown User" string is a dead giveaway).

...much like what was observed by some folks there and there without clear problem resolutions (if someone here has an account on the LibreOffice forums, please link those two threads towards here too).

The distinction is that I've determined this to happen for any file, as long as it's between a flatpaked LibreOffice and another flatpaked application. The problem, however, is that I have no idea if this is just a flatpak packaging bug, a LibreOffice software bug in the way it checks for lockfiles, a bug in the other application (fsearch), or a bug in flatpak's codebase itself.

joshua-stone commented 10 months ago

This behavior also appears to hinder the LibreOffice flatpak's ability to save files when UseLocking is set to false:

https://github.com/flathub/md.obsidian.Obsidian/issues/203

To reproduce, first set the following option in LibreOffice:

Tools → Options → Advanced → Open Expert Configuration → UseLocking → false

Then create a spreadsheet in LibreOffice and close it.

Finally, try to open that spreadsheet using xdg-open inside flatpak:

$ flatpak run --command=xdg-open --filesystem=home org.freedesktop.Platform//22.08 ~/path/to/test-document.ods
o-alquimista commented 9 months ago

I can reproduce on elementary 7.1.

  1. Using Firefox flatpak'ed, download a file that libreoffice will open, and open it from Firefox download history.

    The read-only dialog from LibreOffice appears.

  2. Now open the same downloaded file, but using your (not flatpak'ed) file manager.

    File opens read-write as expected.