electron icon indicating copy to clipboard operation
electron copied to clipboard

[Bug]: Linux file picker portal not working on network drive in Election app

Open atimeofday opened this issue 2 years ago • 8 comments

Preflight Checklist

Electron Version

25.8.1

What operating system are you using?

Other Linux

Operating System Version

Fedora Linux 39.20231101.n.0

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

Context: A set of files is stored in a folder on a user's Google Drive account. On Fedora Linux (Gnome desktop environment), a user is logged into their Google account. This mounts their Google Drive storage as a network device, accessible through the file manager and by other apps. In this case, the Obsidian app is used to access this set of files as a 'Vault'. The folder was configured and used as an Obsidian Vault on MacOS. The configuration is stored in a subfolder named .obsidian, and is cross-platform.

Steps to replicate: Install the Electron-based Obsidian app (Flatpak). Select 'Open folder as vault' option. This opens a window with the file picker portal. Using this window, navigate to a folder in the mounted network drive. Select and confirm that folder to open as a vault.

Expected behavior: Obsidian opens the selected folder.

Actual Behavior

Obsidian is unable to open the selected folder on a network drive.

I contacted the Obsidian Flatpak maintainer to help evaluate the issue. They replicated the issue (without MacOS involved) and determined that it is most likely an upstream Electron issue with the Linux file picker portal, after testing the Flatpak against the AppImage version.

Testcase Gist URL

https://gist.github.com/atimeofday/d8eef403d32d1e65b6782e357ff02d21

Additional Information

Edit: These Flatpak args/permissions were tested as well, and did not solve the issue:

https://docs.flatpak.org/en/latest/sandbox-permissions.html#gvfs-access $ flatpak install md.obsidian.Obsidian $ flatpak run --talk-name=org.gtk.vfs.* --filesystem=xdg-run/gvfsd --filesystem=xdg-run/gvfs md.obsidian.Obsidian

atimeofday avatar Nov 02 '23 18:11 atimeofday

@atimeofday please add a title to the issue

miniak avatar Nov 02 '23 20:11 miniak

@atimeofday please add a title to the issue

Whoops, not sure how I missed that. Fixed. Let me know if there is anything else I can contribute or test

atimeofday avatar Nov 02 '23 20:11 atimeofday

Hello @atimeofday. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

I have never done this with Electron. I will learn. If someone can direct me to how to call the file picker or provide other resources, I would appreciate it. I will also request assistance in the Obsidian community.

atimeofday avatar Nov 02 '23 21:11 atimeofday

I believe I have created a minimum viable test case. Emphasis on minimum - I am learning JS, Electron, and Fiddle nearly from scratch - but I have observed the same success/fail behavior as the app in this test case. I intend to refine it until it is sufficient for someone more experienced to take over. Here is version 1 of the test case:

https://gist.github.com/atimeofday/d8eef403d32d1e65b6782e357ff02d21

This test calls showDirectoryPicker() when the provided button is clicked, then logs the returned value to the dev tools console. I used this as a stepping stone because it can return a selected directory without further configuration. To improve the test case, I am still learning how to configure showOpenFilePicker(), which appears to produce the same dialog as the actual Obsidian app.

In order to configure showOpenFilePicker() properly, I used this command to monitor the Obsidian file picker:

dbus-monitor --session --monitor interface=org.freedesktop.impl.portal.FileChooser

Here is the dbus output of the Obsidian file picker: image

Steps to replicate issue:

  1. Establish Linux environment with the Gnome desktop (Fedora Silverblue 39)
  2. Use Gnome Settings app, Online Accounts tab to log into a Google account
  3. Confirm visible mounting of Google Drive in Gnome Files app (Nautilus)
  4. Install and configure Electron Fiddle
  5. Load provided gist or write test case
  6. Run test case, click provided button, select local folder with file picker dialog, confirm folder name in dev tools console
  7. Run test case, click provided button, select network folder in mounted Google Drive, observe exception in console

The exception I observed with this test case is as follows: image I know this exception does not explain much; I was unsure of how to investigate it more closely.

In case the network drive mounting location and/or method are relevant: I have identified that the Google Drive file system is mounted at /run/user/1000/gvfs/ (Gnome Virtual File System).

Please let me know how I can be of further assistance. I will do what I can.

atimeofday avatar Nov 03 '23 04:11 atimeofday

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

.

maymage avatar Feb 19 '24 12:02 maymage

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

Still reproducible in 29.1.0.

Giwayume avatar Mar 08 '24 00:03 Giwayume

+1

I am using Obsidian on Linux (Flatpak version on Fedora).

I would like to open a vault folder located on my mounted Android MTP device with the Obsidian Linux app (the device has been mounted automatically by the GNOME file manager).

When I try to open the vault nothing happen.

I hope there will be a solution or a workaround someday.

slimhk45 avatar Apr 10 '24 06:04 slimhk45

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

Please re-open this issue. I haven't noticed any change in behavior with the newer versions of Electron being used in Obsidian.

joshua-stone avatar Aug 14 '24 12:08 joshua-stone