Brief summary of the bug. What is it ? Where is it ?
See support ticket. When no version is selected, the variable name request appears to query for all available variables across all definitions, which can result in performance issues if there is a lot of variable data.
Steps to reproduce:
Create an empty report and switch from "all" versions to "specific version" without selecting a version.
OR try a request to /api/variables with a payload where processDefinitionVersions is empty, eg
{ "processDefinitionKey": "aProcess", "processDefinitionVersions": [], "tenantIds": [] }Actual result:
Optimize queries for all variables across all definitions (this can be seen in the response of the /variables request in the network tab).
Expected result:
If no version is selected, no variables should be returned.
Hint:
On first view it looks like in ProcessVariableReader.getVariableNames, the query remains a simple boolQuery when there are no selected versions in any of the variableNameRequests because they're all filtered out with .filter(request -> !CollectionUtils.isEmpty(request.getProcessDefinitionVersions())).