Repository navigation
fix(sidebar): deduplicate GVfs network mounts in devices - #2449
Conversation
Deduplicate volume monitor mounts by root URI and location so that restarting gvfs-daemon (such as on wake from suspend) does not accumulate duplicate entries for network shares in the Devices sidebar. Fixes #2389
The root URI filter in mounts_without_listed_volumes repeated the location filter in mounts_without_volumes, since a mount's location is derived from its root. Keep the location filter and note why the first listed mount wins.
Review and cleanupMerged Review against the description and #2389. The deduplication works. GVfs's Fixes pushed
Manual verification (private Xvfb and private D-Bus, Tests: none added. The behaviour depends on GIO state left by a gvfsd restart, which unit tests cannot fake, and a test of a generic first-per-key filter would only restate Validation
Follow-ups outside this PR
CI: all checks green on |
Description
Deduplicate volume monitor mounts by root URI and location so that restarting
gvfs-daemon.service(e.g. via Omarchy's suspend hook/usr/lib/systemd/system-sleep/unmount-fuse) does not accumulate duplicate entries for network shares in the Devices sidebar.When
gvfsdrestarts, client-sideGDaemonVolumeMonitorkeeps the old mounts in memory. When remounted, a newGMountinstance is created with a different D-Bus ID and prepended to the monitor's mount list. Deduplicating by root URI and location preserves the newest active mount and discards stale duplicates.Visual evidence
How to test
gio mount smb://<server>/<share>orgio mount sftp://127.0.0.1/).systemctl --user restart gvfs-daemon.serviceand mount the share again.Expected result:
The share appears exactly once under Devices rather than creating duplicate rows for each restart.
Related issue
Closes #2389