Skip to content

Commit

Permalink
fix: events filter by request keys query (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored May 6, 2024
1 parent d6ee107 commit c96b5e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions backend/controller/dal/dal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ func TestDAL(t *testing.T) {
assert.NoError(t, err)
assertEventsEqual(t, []Event{logEvent}, events)
})

t.Run("ByRequests", func(t *testing.T) {
events, err := dal.QueryEvents(ctx, 1000, FilterRequests(requestKey))
assert.NoError(t, err)
assertEventsEqual(t, []Event{callEvent, logEvent}, events)
})
})

t.Run("GetRoutingTable", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion backend/controller/dal/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (d *DAL) QueryEvents(ctx context.Context, limit int, filters ...EventFilter
q += fmt.Sprintf(` AND e.deployment_id = ANY($%d::BIGINT[])`, param(deploymentIDs))

if filter.requests != nil {
q += fmt.Sprintf(` AND ir.name = ANY($%d::TEXT[])`, param(filter.requests))
q += fmt.Sprintf(` AND ir.key = ANY($%d::TEXT[])`, param(filter.requests))
}
if filter.types != nil {
// Why are we double casting? Because I hit "cannot find encode plan" and
Expand Down

0 comments on commit c96b5e8

Please sign in to comment.