Keyset pagination errors out when missing parameter values
With keyset pagination enabled on the Projects endpoint, it renders a HTTP/500 if the id_after
parameter is present but without a value set.
Example: GET https://gitlab.com/api/v4/projects?pagination=keyset&per_page=100&order_by=id&sort=asc&id_after=
This should instead either be treated as if id_after
wasn't set at all or like id_after
was set to 0
.
Exception:
PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: ""
LINE 1: ...jects"."visibility_level" = 20 AND (projects.id > '') AND "p...
^
Traceback from https://log.gprd.gitlab.net/app/kibana#/discover/doc/AW5F1e45qthdGjPJueGO/pubsub-rails-inf-gprd-003169?id=flgnKXMB0IyTB7z5nN68 :
| app/services/projects/batch_count_service.rb:13:in `refresh_cache', lib/api/projects_relation_builder.rb:23:in `batch_forks_counting', lib/api/projects_relation_builder.rb:31:in `execute_batch_counting', lib/api/projects_relation_builder.rb:10:in `prepare_relation', lib/api/projects.rb:131:in `block in present_projects', lib/api/helpers/pagination_strategies.rb:9:in `paginate_with_strategies', lib/api/projects.rb:120:in `present_projects', lib/api/projects.rb:191:in `block (2 levels) in <class:Projects>', ee/lib/gitlab/ip_address_state.rb:10:in `with', ee/lib/omni_auth/strategies/group_saml.rb:41:in `other_phase', ee/lib/gitlab/jira/middleware.rb:19:in `call' |