fix(alarms): historize the real operator for shelve/unshelve/enable/disable transitions

This commit is contained in:
Joseph Doherty
2026-06-11 13:14:00 -04:00
parent 5ea6e9d7d9
commit 56750e110f
2 changed files with 39 additions and 1 deletions
@@ -512,7 +512,13 @@ public sealed class ScriptedAlarmHostActor : ReceiveActor
{
EmissionKind.Acknowledged => e.Condition.LastAckUser ?? "system",
EmissionKind.Confirmed => e.Condition.LastConfirmUser ?? "system",
EmissionKind.CommentAdded => e.Condition.Comments.Count > 0 ? e.Condition.Comments[^1].User : "system",
// Shelve / unshelve / enable / disable / comment ops each append the acting user as the LAST audit
// entry on the emitted condition (engine auto-unshelve appends "system"); read it from there.
EmissionKind.CommentAdded
or EmissionKind.Shelved
or EmissionKind.Unshelved
or EmissionKind.Enabled
or EmissionKind.Disabled => e.Condition.Comments.Count > 0 ? e.Condition.Comments[^1].User : "system",
_ => "system",
};