diff --git a/server/router/api/v1/activity_service.go b/server/router/api/v1/activity_service.go index 7496e19e9..f4f4a6b08 100644 --- a/server/router/api/v1/activity_service.go +++ b/server/router/api/v1/activity_service.go @@ -29,6 +29,9 @@ func (s *APIV1Service) ListActivities(ctx context.Context, request *v1pb.ListAct if limit <= 0 { limit = DefaultPageSize } + if limit > MaxPageSize { + limit = MaxPageSize + } limitPlusOne := limit + 1 activities, err := s.Store.ListActivities(ctx, &store.FindActivity{ Limit: &limitPlusOne, diff --git a/store/db/mysql/activity.go b/store/db/mysql/activity.go index bcc9dedc7..e304a9487 100644 --- a/store/db/mysql/activity.go +++ b/store/db/mysql/activity.go @@ -5,7 +5,6 @@ import ( "fmt" "strings" - "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" diff --git a/store/db/postgres/activity.go b/store/db/postgres/activity.go index ab8a2e329..96140e87e 100644 --- a/store/db/postgres/activity.go +++ b/store/db/postgres/activity.go @@ -5,7 +5,6 @@ import ( "fmt" "strings" - "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson" diff --git a/store/db/sqlite/activity.go b/store/db/sqlite/activity.go index 040a816b9..eaa2fcb03 100644 --- a/store/db/sqlite/activity.go +++ b/store/db/sqlite/activity.go @@ -5,7 +5,6 @@ import ( "fmt" "strings" - "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protojson"