MHRA / products

Products Information Portal and Microservices
MIT License
11 stars 9 forks source link

High page numbers show a crash message #747

Open majikandy opened 4 years ago

majikandy commented 4 years ago

High page numbers should not give a crash page

Manually entering high page numbers in the URL cause a page crash

To Reproduce

Steps to reproduce the behaviour:

  1. Go to search for caffeine
  2. modify the url to have page=100000000000000
  3. observe crash as per pic

Expected behaviour

No crash, just no results, similar to trying page 5 on a result set with only 4 pages.

Screenshots

Without useGraphQl=true

Screenshot 2020-05-01 10 29 18

With useGraphQl=true

Screenshot 2020-05-01 10 41 02

Additional context

probably only worth fixing for the useGraphQl=true scenario

Worth considering that maybe showing page 5 or page on a result set with only 4 pages could just redirect to page=4. Equally negative numbers currently show page 1 but perhaps a redirect to page=1 would be clearer.

TimboTambo commented 4 years ago

Could be exceeding an i32 max num limit somewhere in the API?