From 3c0105b2a04806cc820ee5709077641c693398fa Mon Sep 17 00:00:00 2001 From: Yu Xia Date: Mon, 26 Sep 2022 12:40:57 -0700 Subject: [PATCH] Fix list batch operation to include division (#3431) * Fix list batch operation to include division --- service/frontend/workflow_handler.go | 7 ++++++- service/frontend/workflow_handler_test.go | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/service/frontend/workflow_handler.go b/service/frontend/workflow_handler.go index 1b933bdfb7f..8e8f4cca951 100644 --- a/service/frontend/workflow_handler.go +++ b/service/frontend/workflow_handler.go @@ -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 diff --git a/service/frontend/workflow_handler_test.go b/service/frontend/workflow_handler_test.go index 888148da7a9..aee69e0e861 100644 --- a/service/frontend/workflow_handler_test.go +++ b/service/frontend/workflow_handler_test.go @@ -27,6 +27,7 @@ package frontend import ( "context" "errors" + "strings" "testing" "time" @@ -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{