headscale/hscontrol/mapper
Kristoffer Dalby 3b4b9a4436 hscontrol: fix tag updates not propagating to node self view
When SetNodeTags changed a node's tags, the node's self view wasn't
updated. The bug manifested as: the first SetNodeTags call updates
the server but the client's self view doesn't update until a second
call with the same tag.

Root cause: Three issues combined to prevent self-updates:

1. SetNodeTags returned PolicyChange which doesn't set OriginNode,
   so the mapper's self-update check failed.

2. The Change.Merge function didn't preserve OriginNode, so when
   changes were batched together, OriginNode was lost.

3. generateMapResponse checked OriginNode only in buildFromChange(),
   but PolicyChange uses RequiresRuntimePeerComputation which
   bypasses that code path entirely and calls policyChangeResponse()
   instead.

The fix addresses all three:
- state.go: Set OriginNode on the returned change
- change.go: Preserve OriginNode (and TargetNode) during merge
- batcher.go: Pass isSelfUpdate to policyChangeResponse so the
  origin node gets both self info AND packet filters
- mapper.go: Add includeSelf parameter to policyChangeResponse

Fixes #2978
2026-01-20 10:13:47 +01:00
..
batcher.go hscontrol: fix tag updates not propagating to node self view 2026-01-20 10:13:47 +01:00
batcher_lockfree.go oidc: make email verification configurable 2025-12-18 11:42:32 +00:00
batcher_test.go batcher: ensure removal from batcher 2025-12-17 13:19:26 +01:00
builder.go change: smarter change notifications 2025-12-16 10:12:36 +01:00
builder_test.go bunch of qol (#2748) 2025-08-27 17:09:13 +02:00
mapper.go hscontrol: fix tag updates not propagating to node self view 2026-01-20 10:13:47 +01:00
mapper_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
suite_test.go introduce mapper package 2023-06-08 16:34:15 +02:00
tail_test.go types: add option to disable taildrop, improve tests (#2955) 2025-12-12 11:35:16 +01:00