When middle-clicking a bookmark to a remote location, Nautilus opens the new tab before checking it can actually connect / mount it
Affected version
- Nightly flatpak: Yes
- Other: 44.x and every previous version
Steps to reproduce
- Bookmark some folder to some remote location (ex: in some SSH/SFTP server)
- Make that server go offline (or change its hostname, port, etc.) or disable your computer's network connectivity
- Middle-click that (unmounted) bookmark (or use right-click >
Open in New Tab
/Open in New Window
)
Current behavior
Nautilus first opens a new tab for it, and then shows this error dialog:
...but then you're still left with a useless newly opened tab that points to your home directory... a tab that you then have to close manually.
Expected behavior
- Check network (and remote) connectivity and connectability before creating the tab.
- While doing the check (or mounting any drive, even a slow local storage drive) show a GtkSpinner on the right of that bookmark (and spin it only if animations are not turned off), instead of opening a new tab too soon. Don't forget to stop the GtkSpinner afterwards though, to avoid continous CPU usage.
- Also watch out for race conditions; refactoring in this area might actually solve issue #2855 (which is not about the errors/un-mountable scenario, but about the speed at which tabs get assigned), indirectly?
Additional information
Middle-click-mounting a non-bookmark online account (such as a nextcloud or google drive account in the sidebar) does the correct behavior: it shows the spinner in the sidebar and does not create the tab before the connection is established. So in theory, the code for this is already out there, you just need to unify it and make it apply to bookmarks as well.
Edited by Jeff Fortin