refactor(adminui): harden SetFullName (reject blank ref) + cover alarm-flag re-pick

Code-review nits: SetFullName now throws on a blank reference (was silently
persisting FullName:null → silent deploy-time bind failure), and a new test
covers the alarm-typed re-pick combo (SeedDefaultAlarm over an already-edited
alarm leaves it intact).
This commit is contained in:
Joseph Doherty
2026-06-19 02:08:43 -04:00
parent da57c307a7
commit e047af0553
2 changed files with 28 additions and 0 deletions
@@ -54,6 +54,9 @@ public static class TagConfigJson
/// </summary>
public static string SetFullName(string? json, string fullName)
{
// A blank reference is never a valid Galaxy bind — surface it loudly rather than persisting
// a poisoned "FullName": null/"" that would silently fail to bind at deploy time.
ArgumentException.ThrowIfNullOrWhiteSpace(fullName);
var o = ParseOrNew(json);
o["FullName"] = JsonValue.Create(fullName);
return Serialize(o);