mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-21 00:01:32 +02:00
Add four tests that verify the tags-as-identity ownership transition correctly persists to the database when converting a user-owned node to a tagged node via SetTags: - TestSetTags_ClearsUserIDInDatabase: verifies user_id is NULL in DB - TestSetTags_NodeDisappearsFromUserListing: verifies ListNodes by user - TestSetTags_NodeStoreAndDBConsistency: verifies in-memory and DB agree - TestSetTags_UserDeletionDoesNotCascadeToTaggedNode: verifies user deletion does not cascade-delete tagged nodes Three of these tests currently fail because GORM's struct-based Updates() silently skips nil pointer fields, so user_id is never written as NULL to the database after SetNodeTags clears it in memory. Updates #3161
25 KiB
25 KiB