Skip to content

Commit

Permalink
Add validation for invalid starttime filter for standard visibility (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
meiliang86 authored Jan 21, 2022
1 parent aa69178 commit 1e19178
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var unsupportedQuery = []string{
`ExecutionStatus = "Running" AND WorkflowType = "xyz"`,
`WorkflowID = "abc" OR WorkflowType = "xyz"`,
`WorkflowID != "abc"`,
`StartTime < "2022-01-15T05:43:12.74127Z"`,
}

func TestSupportedQueryFilters(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ func (vi *valuesInterceptor) Values(name string, values ...interface{}) ([]inter
}
return values, err
case searchattribute.StartTime:
if len(values) != 2 {
return nil, query.NewConverterError("StartTime only supports BETWEEN ... AND ... filter")
}

values, err := vi.nextInterceptor.Values(name, values...)
if err == nil {
minTime, err := time.Parse(time.RFC3339Nano, values[0].(string))
Expand Down

0 comments on commit 1e19178

Please sign in to comment.