C.W.K.
Stream
Lesson 01 of 04 · published

A Saved Endpoint Is Not a Mount

~12 min · saved-endpoint, mount-truth, projection

Level 0Lost in Finder
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"'I know where the server is' and 'the server is connected right now' are two completely different facts. Confusing them is how a sidebar lies."

Two Facts People Blur Together

When you connect to a network share, two separate things happen. First, Waygate can remember where that share is — a saved endpoint you can reconnect to later. Second, macOS actually mounts the volume, making its files reachable. A naive app treats the saved endpoint as if it were the mount: it shows the share in the sidebar as available whenever it has the endpoint. That's a lie the moment the network drops.

The Endpoint Is Just an Address

Waygate's saved network location is a sanitized endpoint: the scheme (smb), the host, the share name, and a display name. That's it — an address, like a saved contact. Having a contact's address doesn't mean they're home. The endpoint lets Waygate offer 'reconnect,' which asks macOS to run its connect flow; it never asserts, on its own, that the share is mounted and its files are there.

Mount Truth Comes From the System

For the real question — is this volume actually mounted right now? — Waygate observes macOS mount and unmount notifications. Those are the truth. A saved endpoint that isn't currently mounted shows as offline in the sidebar, not as a browsable folder. If the sidebar ever shows a share as live when it isn't, that's a projection error (Track 2 again): the app trusted its saved address instead of the system's mount state.

A saved endpoint is a sanitized address, not a claim of an active mount. Waygate stores scheme, host, share, and display name; it asks macOS to run the connect flow and observes mount/unmount notifications as the real truth. A stale 'looks mounted' sidebar entry is a projection error, never a fact the app may assert on its own.
This is projection-not-truth, applied to volumes. A mount is exactly like a file: the system owns whether it's really there, and Waygate shows a projection that must be revalidated against live notifications. The same discipline that keeps a file row honest keeps a network share honest — the endpoint is a reference, the mount state is the truth, and the two are never conflated.

Code

Sanitized endpoint; mount truth from the system·swift
struct SavedNetworkLocation {
    let scheme: String       // "smb"
    let host: String         // "fileserver.local"
    let share: String        // "projects"
    let displayName: String  // "Projects (Office)"
    // NOTE: no username, no password, no cached file list. Just an address.
}

// The REAL mount truth comes from macOS, not from having a saved endpoint:
func observeMounts() {
    let nc = NSWorkspace.shared.notificationCenter
    nc.addObserver(forName: NSWorkspace.didMountNotification, object: nil, queue: nil) { note in
        self.markOnline(volume: note.mountedVolumeURL)     // now it's really there
    }
    nc.addObserver(forName: NSWorkspace.didUnmountNotification, object: nil, queue: nil) { note in
        self.markOffline(volume: note.unmountedVolumeURL)  // gone -- update the projection
    }
}

External links

Exercise

Connect to a network share, then disconnect the network without ejecting. Watch how different apps' sidebars behave: which keep showing the share as available, and which mark it offline? For the ones that keep showing it, predict what happens if you try to open a file. Then state the rule that separates the honest apps from the lying ones.
Hint
Apps that treat the saved endpoint as truth keep the share looking live, and clicking a file either beachballs (Track 6) or fails confusingly. Apps that observe mount notifications flip the share to offline immediately. The dividing rule: mount state must come from the system's live notifications, never inferred from the fact that you once saved the address.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.