headscale/hscontrol/types
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
..
change hscontrol: fix tag updates not propagating to node self view 2026-01-20 10:13:47 +01:00
testdata Restore support for "Override local DNS" (#2438) 2025-04-17 17:16:59 +02:00
api_key.go types: make pre auth key use bcrypt (#2853) 2025-11-12 16:36:36 +01:00
common.go modernize: run gopls modernize to bring up to 1.25 (#2920) 2025-12-01 19:40:25 +01:00
common_test.go mapper: produce map before poll (#2628) 2025-07-28 11:15:53 +02:00
config.go oidc: make email verification configurable 2025-12-18 11:42:32 +00:00
config_test.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
const.go improve testing of route failover logic 2024-04-15 12:31:53 +02:00
node.go gen: regenerate protobuf code 2026-01-14 09:32:46 +01:00
node_tags_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
node_test.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
policy.go feat: implements apis for managing headscale policy (#1792) 2024-07-18 07:38:25 +02:00
preauth_key.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
preauth_key_test.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
routes.go Redo route code (#2422) 2025-02-26 16:22:55 +01:00
types_clone.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
types_view.go make tags first class node owner (#2885) 2025-12-02 12:01:25 +01:00
users.go types: use Username() in User.Proto() when Name is empty 2026-01-14 13:16:51 +01:00
users_test.go oidc: make email verification configurable 2025-12-18 11:42:32 +00:00
version.go cli: use gobuild version handling (#2770) 2025-09-12 11:47:31 +02:00