Files
Nick Khyl 2a6b9407b8 ipn/ipnext, feature/guivisibility: move GUI visibility out of ipnlocal, send deltas only for changed peers
Replace the GUIVisibilityProvider/Filter plumbing and the per-session
hidden-peer tracking with a generic per-session notify hook, and let the
guivisibility extension own all policy interpretation.

ipnlocal now only keeps the session's effective policy snapshot (which it
already fetched) and runs ipnext.Hooks.MutateNotifyForSessionLocked on the
per-session copy of each Notify, after gating, plus on the initial Notify.
The hook receives an ipnext.WatchSession exposing that snapshot.

The extension populates Notify.NodeGUIVisibility with the hidden peers
among the nodes the Notify covers: all peers when it carries Policy
(initially and on policy change), or the PeersChanged peers otherwise.
Absent means visible, so a Policy-bearing Notify replaces the client's
visibility state and a peer-change Notify updates only the changed peers.
No NodeGUIVisibilityChanges/Removed fields and no per-session node state
are needed: removed peers simply leave the client's peer set, and full
netmap updates already resend every peer alongside SelfChange.

When the feature isn't linked, the hook slice is empty and the fast path
in notifyForSessionLocked is unchanged. When the policy isn't configured,
the hook costs a snapshot lookup per session per Notify and sends nothing.

Updates tailscale/corp#44104

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2026-11-03 14:20:09 -08:00
..