No auto-refresh of tabs in synthetically firmlinked unique locations [CLOSED]

Questions, glitches, bugs and crashes
Post Reply
JayB
Posts: 185
Joined: Sun Jan 08, 2017 4:38 pm

No auto-refresh of tabs in synthetically firmlinked unique locations [CLOSED]

Post by JayB » Sun Feb 28, 2021 12:23 am

I just noticed a weird bug: when I mount a volume (e.g. a RAM disk or NAS) in /Volumes, and when I create a new file or folder, or delete a file or folder, Nimble Commander (like Finder) automatically refreshes the folder contents of the currently open tab. However, when I mount the same volume at a different mountpoint, i.e. not in /Volumes, then there is no auto-refresh in NC. I actually have to hit CMD-R to manually refresh, or navigate up and down again. I tested this with the mountpoint in /mnt, which on my system is a firmlinked symbolic link to /System/Volumes/Data/mnt. So this is something that should be addressed. I also tested this in Finder, and Finder actually does the automatic refresh, whether the volume is mounted in /Volumes or /mnt or somewhere else. I tested this with mounts using diskutil and smb.

Code: Select all

diskutil mount -mountPoint /mnt/foo "foo"

Code: Select all

mount_smbfs //<user>:"<password>"@<localIP>/bar "/mnt/bar/"
(macOS 11.2.2, Intel MBP)
Last edited by JayB on Sun Feb 28, 2021 1:41 am, edited 2 times in total.

JayB
Posts: 185
Joined: Sun Jan 08, 2017 4:38 pm

Re: [BUG] No automatic refresh of volumes at non-standard mountpoints

Post by JayB » Sun Feb 28, 2021 12:55 am

Addendum: this actually doesn't seem to be related to the mountpoints, but possibly to the fact that the mountpoints are in firmlinked paths on /System/Volumes/Data.

For example, on my system I've also reactivated the /home folder, which is a firmlinked symbolic link to /System/Volumes/Data/home… and some default macOS folders have symlinks in /home, e.g. ~ and /Users/Shared, another Unix home folder in /usr/local etc., but there are also other folders that have no direct representation in the macOS filesystem structure, i.e. unique locations, and the same bug occurs in the latter.

So for example, you have a directory /home/foo/bar, which is actually (firmlinked) /System/Volumes/Data/home/foo/bar, and when you create a new file or folder in there, or try to delete it, Nimble Commander doesn't seem to recognize that, i.e. no auto-refresh.

Here, too, Finder doesn't have this problem, only NC.
Last edited by JayB on Sun Feb 28, 2021 1:44 am, edited 2 times in total.

JayB
Posts: 185
Joined: Sun Jan 08, 2017 4:38 pm

Re: [BUG] No automatic refresh of volumes at non-standard mountpoints

Post by JayB » Sun Feb 28, 2021 1:05 am

To clarify, these are of course synthetic firmlinks defined in /private/etc/synthetic.conf

In the case of /home, you'd also have to comment out the line containing "/home" in /private/etc/auto_master, then `sudo umount home`, remove /System/Volumes/Data/home, create a new home directory there, and only then establish the firmlink.

But you can probably do it yourself with a test firmlink, e.g.

Code: Select all

sudo mkdir /System/Volumes/Data/foo
then open /etc/synthetic.conf and add

Code: Select all

foo	System/Volumes/Data/foo
then reboot, and then play around in /foo with file/folder creation & deletion. That should result in the same bug.

JayB
Posts: 185
Joined: Sun Jan 08, 2017 4:38 pm

Re: [BUG] No auto-refresh of tabs in synthetically firmlinked unique locations

Post by JayB » Sun Feb 28, 2021 10:48 am

It's also a basic bug when directly operating on /System/Volumes/Data.

Create a new empty folder there in NC or in iTerm, or remove a file there, and NC doesn't show it until you actually refresh the tab manually.

User avatar
mike
Posts: 926
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: [BUG] No auto-refresh of tabs in synthetically firmlinked unique locations

Post by mike » Sun Feb 28, 2021 5:55 pm

Brilliant, I was able to reproduce this on my side, thank you for the report.
What's happening in short is that FSEvents (https://en.wikipedia.org/wiki/FSEvents) sends bogus paths when notifying about changes.
For instance, when changing something in /System/Volumes/Data/Foo the system sends events for /Foo, which doesn't even exist 🤦‍♂️
No wonder Nimble Commander ignores these paths and doesn't refresh listings.
Finder also doesn't catch notification events in this case on my setup - the problem is in the system itself.

Honestly, I don't know what to do with it - I have no desire to add further hacks for this clusterfuck with firmlinks and R/O root that Apple has made.
Maybe just don't touch anything inside /System/Volumes/Data/ at all? Clearly the system itself barely handles this set of oddities.

JayB
Posts: 185
Joined: Sun Jan 08, 2017 4:38 pm

Re: [BUG] No auto-refresh of tabs in synthetically firmlinked unique locations

Post by JayB » Sun Feb 28, 2021 10:37 pm

:lol: Oh-my-god… hashtag AppleCoreRot.

Luckily, Apple themselves have provided us with a user-facing solution for a workaround in macOS, namely with their (non-standard) /private directory, which does already contain a couple of locations that you would normally expect in the root directory. So you just have to create /private/mnt, then create a firmlink /mnt > /private/mnt, and it will work just fine, in the same way /root > /private/var/root will work. Because it's not a unique synthetic firmlink in the root of /System/Volumes/Data, but a firmlink to a path whose origin (/private) is hard-firmlinked by default system rules, a use case macOS obviously has accounted for. As for the /home directory, you'd have to firmlink this directly to /Users, and then hack around in /Users instead of /System/Volumes/Data/home.

But the FSEvents thing is actually pretty messed up.

Post Reply