Posted Jul 27, 2025
closed
Problem
When visiting https://oldergay.men/users, the pagination shows:
- "Displaying items 1-21 of 83162 in total"
- Page numbers up to 3961
- But clicking on page 3961 (or any page > 500) silently redirects back to page 1
This is a terrible user experience that frustrates users who are trying to browse through the member list.
Background
We recently added:
- MemoryEfficientPagination concern with MAX_PAGE_NUMBER = 500 limit
- Cursor pagination as an alternative
- Page limit enforcement that redirects high pages to page 1
However, the pagination UI still shows all possible page numbers based on total record count, creating this confusing situation.
Questions to Address
- Should we remove the page limit entirely and let users access high pages?
- Is cursor pagination causing memory problems that necessitated the page limit?
- Should we temporarily disable cursor pagination site-wide and use only standard Pagy pagination?
- If we keep the page limit, how do we update the UI to not show inaccessible page numbers?
User Impact
- Users see page numbers they can't actually access
- Clicking high page numbers silently fails with no error message
- This breaks the expected behavior of pagination
- Users can't browse to older members in the list
Priority
HIGH - This is actively frustrating users trying to use the site.
Related Code
- app/controllers/concerns/memory_efficient_pagination.rb (MAX_PAGE_NUMBER = 500)
- app/controllers/users_controller.rb (includes MemoryEfficientPagination)
- app/middleware/high_page_protection.rb
- Pagy pagination UI generation
Temporary Fix Options
- Remove page limits entirely - let users access any page
- Update pagination UI to hide pages > 500
- Show error message instead of silent redirect
- Disable cursor pagination temporarily if it's causing issues