headscale/hscontrol/mapper
Kristoffer Dalby 9371b4ee28 mapper: fix empty Peers list not clearing client peer state
When a FullUpdate produces zero visible peers (e.g., a restrictive
policy isolates a node), the MapResponse has Peers: [] (empty
non-nil). The Tailscale client only processes Peers as a full
replacement when len(Peers) > 0 (controlclient/map.go:462), so an
empty list is silently ignored and stale peers persist.

This triggers when a FullUpdate() replaces a pending PolicyChange()
in the batcher. The PolicyChange would have used computePeerDiff to
send explicit PeersRemoved, but the FullUpdate goes through
buildFromChange which sets Peers: [] that the client ignores.

When a full update produces zero peers, compute the peer diff
against lastSentPeers and add explicit PeersRemoved entries so the
client correctly clears its stale peer state.
2026-04-10 13:18:56 +01:00
..
batcher.go mapper: fix empty Peers list not clearing client peer state 2026-04-10 13:18:56 +01:00
batcher_bench_test.go mapper/batcher: replace connected map with per-node disconnectedAt 2026-03-16 02:22:56 -07:00
batcher_concurrency_test.go mapper/batcher: serialize per-node work to prevent out-of-order delivery 2026-03-19 07:05:58 +01:00
batcher_scale_bench_test.go mapper/batcher: replace connected map with per-node disconnectedAt 2026-03-16 02:22:56 -07:00
batcher_test.go hscontrol/poll,state: fix grace period disconnect TOCTOU race 2026-03-19 07:05:58 +01:00
batcher_unit_test.go mapper/batcher: replace connected map with per-node disconnectedAt 2026-03-16 02:22:56 -07:00
builder.go policy/v2,state,mapper: implement per-viewer via route steering 2026-04-01 14:10:42 +01:00
builder_test.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
mapper.go mapper: remove Batcher interface, rename to Batcher struct 2026-03-14 02:52:28 -07:00
mapper_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00
node_conn.go mapper/batcher: replace connected map with per-node disconnectedAt 2026-03-16 02:22:56 -07:00
tail_test.go types,mapper,integration: enable Taildrive and add cap/drive grant lifecycle test 2026-04-01 14:10:42 +01:00