Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions service/history/workflow/mutable_state_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2597,8 +2597,15 @@ func (ms *MutableStateImpl) ApplyWorkflowExecutionStartedEvent(
// Initialize chasm tree once for new workflows.
// Using context.Background() because this is done outside an actual request context and the
// chasmworkflow.NewWorkflow does not actually use it currently.
mutableContext := chasm.NewMutableContext(context.Background(), ms.chasmTree.(*chasm.Node))
ms.chasmTree.(*chasm.Node).SetRootComponent(chasmworkflow.NewWorkflow(mutableContext, ms))
root, ok := ms.chasmTree.(*chasm.Node)
softassert.That(ms.logger, ok, "chasmTree cast failed")

validationContext := chasm.NewContext(context.Background(), root)
_, err := root.Component(validationContext, chasm.ComponentRef{})
if common.IsNotFoundError(err) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it returns NotFound due to which check? Initial versioned transition check?
I thought it kinda like a undefined behavior. But if it works I don't have a objection. we probably want a test to make sure this always work though.

mutableContext := chasm.NewMutableContext(context.Background(), root)
root.SetRootComponent(chasmworkflow.NewWorkflow(mutableContext, ms))
}
}

event := startEvent.GetWorkflowExecutionStartedEventAttributes()
Expand Down
Loading