Changing Releases page sort causes errors after paginating
Summary
Using the sort controls on the Releases pages after pagination leads to unexpected results and/or errors.
Steps to reproduce
- Navigate to https://staging.gitlab.com/nfriend/public-release-test/-/releases
- Click the Next button
- Once the page finished loading, change the sort from Released date to Created date
Issue #1: The page shows an empty state with pagination controls
- Then, click the Prev button
- Refresh the page
Issue #2: The page shows an error and doesn't load any releases
Output of checks
This bug happens on staging (but will soon happen on GitLab.com).
Additional information
This is related to !62256 (merged), which fixed a different issue with this page's pagination.
!62256 (merged) didn't cause this bug, but it did make this bug more obvious. This is because this bug is related to the information embedded in the pagination cursors, and prior to !62256 (merged), the pagination cursors didn't contain the correct information.
Possible fixes
Reset the before/after cursor when the sort is changed. This will place the user back on page 1 whenever they change the sort order.