foliate icon indicating copy to clipboard operation
foliate copied to clipboard

Flathub version 2.6.4 unreliable/fails-to opening /run/user/{uid}/doc/{id} books.

Open rwperrott opened this issue 2 years ago • 2 comments

Describe the bug A re-open or library open of a /run/user/{uid}/doc/{digits} file, always fails for the Flathub version, after a prior successful open from calibre, and shows this in the middle of the window:

"Could not open file" "file not found"

I tried using Flatseal, to set Flatpack permissions, as follows, "All users file" turned on and adding /run/user/{uid}/doc to "Other Files", but it didn't help.

To Reproduce Steps to reproduce the behaviour:

  1. Pick a EPUB book in calibre.
  2. Right click on "EPUB" in the "Formats" row.
  3. Select the "Open With" menu item and ensure that Foliate was added as one of the "Open With" programs.
  4. Select Foliate to open the book with.
  5. It then hopefully opens the file, assuming it doesn't bug spin-forever, including for Sigil validated EPUBs.
  6. If the book did open, close foliate, the reopen foliate directly.
  7. See the bug, as above.

Expected behavior Always be able to open a known existing book file, unless it has a critical structural error, or is genuinely missing.

Version:

  • Foliate version: 2.6.4
  • OS/Distribution and version: Linux Mint 21 MATE 64-bit
  • Desktop environment: MATE
  • Installation method: Flatpak

Additional context The Flathub version of Sigil seems to have trouble opening EPUBs from calibre or directly from previous files.

If it requires additional Flathub permission tweaks, to fix the Foliate issue, please specify what these are.

As it stands the Flatpack version is useless to me, so I'll have to continue using the deb version, and keep reinstalling for each new Foliate and OS version.

rwperrott avatar Sep 19 '22 21:09 rwperrott

Yes, the files exported via the document portal is not persistent.

I'm not sure you could export documents persistently at all with Flatpak. Maybe one could try exporting them with flatpak-document-export, which I'm guessing might default to persistent exports because there's a --transient option. (I have not tried this, though.) And I'm not sure if there's some other Flatpak configuration that could solve this problem.

One way to sort of work around this this would be to use Tracker. And that is probably better anyway for people who use Foliate to directly open files (as opposed to always launching Foliate from another app like a file manager) because it also handles the situation where the file is renamed or moved. However that will of course require one to index files with Tracker. Also I just realized that I forgot to add --talk-name=org.freedesktop.Tracker3.Miner.Files in the Flatpak manifest, which I think is needed for reading the system's Tracker database in Flatpak.

johnfactotum avatar Sep 21 '22 09:09 johnfactotum

Upstream issue: https://github.com/flatpak/xdg-desktop-portal/issues/133

johnfactotum avatar Dec 10 '23 18:12 johnfactotum