mutableState, err := workflowContext.LoadMutableState(ctx, r.shardContext)
if err != nil {
return serviceerrors.NewRetryReplication(
"sync HSM state encountered workflow not found",
namespaceID.String(),
execution.GetWorkflowId(),
execution.GetRunId(),
common.EmptyEventID,
common.EmptyVersion,
lastItem.EventId+1, // underlying resend logic is exclusive-exclusive
lastItem.Version,
)
}
return err
}