Series list shows a max of 20 items
Problem
Currently, Series that contain more than 20 books are failing to display the complete list. The view is capping the results at 20 items, which results in earlier books in the series being skipped and hidden from the UI.
Max at 20
URL: https://openlibrary.org/series/OL327402L/Doctor_Who_New_Series_Adventures
Reproducing the bug
- Navigate to a Series with >20 books (e.g.,
/series/OL327402L/Doctor_Who_New_Series_Adventures). - Count the visible books.
- Observe that only 20 books are rendered, and earlier volumes are missing.
- Expected behavior: See full list of books on the series or pagination
- Actual behavior: The list shows a max of 20 book on the series even though it has more
Context
- Browser: Tried on Safari and Chrome
- OS : MacOS
- Logged in (Y/N): Y
- Environment: prod
Breakdown
Series pages only display a maximum of 20 books (skipping early volumes)
Description: Currently, when viewing a Series that contains more than 20 works, the page only renders a maximum of 20 books. Because of this artificial limit, earlier books in the series are being skipped and hidden from the UI entirely.
Steps to Reproduce:
- Navigate to a Series with >20 books (e.g., Doctor Who New Series Adventures).
- Observe the list of books rendered on the page.
- Note that the list is capped at exactly 20 books, and earlier volumes in the series are missing.
Implementation Details (for maintainers)
The issue is likely caused by a default database query limit (e.g., limit=20) being applied when fetching the WorkSeriesEdge records for the view, without proper pagination or limit overrides in place for the new Series namespace.
Requirements Checklist
- [ ] Identify the query fetching the books for the Series view (likely in the controller handling
/series/). - [ ] Override the default limit (e.g.,
limit=Noneor a higher sensible default) OR implement/fix pagination for Series pages. - [ ] Verify that all books in a >20 book series render correctly in the proper order.
Related files
openlibrary/plugins/openlibrary/lists.py(Likely location of the Series/Lists view controller)
Stakeholders
- cc @cdrini - Pivoting to this priority bug as discussed on Slack!
Instructions for Contributors
- Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.
Hi, @cdrini ! would like this issue to be assigned to me, so I can start working on it as we discussed. Thanks again for the info on this issue and make It a priority.
Awesome thank you @IvanPisquiy06 ! I think the issue is here: https://github.com/internetarchive/openlibrary/blob/267e912810b3bf217240f44e65f072e360c80811/openlibrary/core/lists/model.py#L670 . The things request or the lower get baby request have a default limit of 20, I think. We can ramp that up to a larger number, like 500, and show a warning in the ui of the series has that many books.
Default for this view should be 100; high enough for most series, low enough to avoid performance issues.