Skip to content

Commit

Permalink
Fix list batch operation to include division (#3431)
Browse files Browse the repository at this point in the history
* Fix list batch operation to include division
  • Loading branch information
yux0 authored and dnr committed Sep 29, 2022
1 parent 02e2edf commit 3c0105b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion service/frontend/workflow_handler.go
Expand Up @@ -3950,7 +3950,12 @@ func (wh *WorkflowHandler) ListBatchOperations(
Namespace: request.GetNamespace(),
PageSize: int32(wh.config.VisibilityMaxPageSize(request.GetNamespace())),
NextPageToken: request.GetNextPageToken(),
Query: fmt.Sprintf("%s = '%s'", searchattribute.WorkflowType, batcher.BatchWFTypeName),
Query: fmt.Sprintf("%s = '%s' and %s='%s'",
searchattribute.WorkflowType,
batcher.BatchWFTypeName,
searchattribute.TemporalNamespaceDivision,
batcher.NamespaceDivision,
),
})
if err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion service/frontend/workflow_handler_test.go
Expand Up @@ -27,6 +27,7 @@ package frontend
import (
"context"
"errors"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -2261,7 +2262,7 @@ func (s *workflowHandlerSuite) TestListBatchOperations() {
_ context.Context,
request *manager.ListWorkflowExecutionsRequestV2,
) (*manager.ListWorkflowExecutionsResponse, error) {

s.True(strings.Contains(request.Query, searchattribute.TemporalNamespaceDivision))
return &manager.ListWorkflowExecutionsResponse{
Executions: []*workflowpb.WorkflowExecutionInfo{
{Execution: &commonpb.WorkflowExecution{
Expand Down

0 comments on commit 3c0105b

Please sign in to comment.