fix(triggers): seed the trigger-expression attribute snapshot at actor startup
This commit is contained in:
@@ -60,6 +60,7 @@ public class ScriptActor : ReceiveActor, IWithTimers
|
||||
SiteRuntimeOptions options,
|
||||
ILogger logger,
|
||||
Script<object?>? compiledTriggerExpression = null,
|
||||
IReadOnlyDictionary<string, object?>? initialAttributes = null,
|
||||
ISiteHealthCollector? healthCollector = null,
|
||||
IServiceProvider? serviceProvider = null)
|
||||
{
|
||||
@@ -76,6 +77,15 @@ public class ScriptActor : ReceiveActor, IWithTimers
|
||||
_scope = scriptConfig.Scope;
|
||||
_compiledTriggerExpression = compiledTriggerExpression;
|
||||
|
||||
// Seed the trigger-expression attribute snapshot from the instance's
|
||||
// initial attribute set so static attributes (which never re-emit an
|
||||
// AttributeValueChanged after deploy) evaluate correctly at startup.
|
||||
if (initialAttributes != null)
|
||||
{
|
||||
foreach (var kvp in initialAttributes)
|
||||
_attributeSnapshot[kvp.Key] = kvp.Value;
|
||||
}
|
||||
|
||||
// Parse trigger configuration
|
||||
_triggerConfig = ParseTriggerConfig(scriptConfig.TriggerType, scriptConfig.TriggerConfiguration);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user