openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Series list shows a max of 20 items

Open IvanPisquiy06 opened this issue 8 months ago • 3 comments

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 Image

URL: https://openlibrary.org/series/OL327402L/Doctor_Who_New_Series_Adventures

Reproducing the bug

  1. Navigate to a Series with >20 books (e.g., /series/OL327402L/Doctor_Who_New_Series_Adventures).
  2. Count the visible books.
  3. 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:

  1. Navigate to a Series with >20 books (e.g., Doctor Who New Series Adventures).
  2. Observe the list of books rendered on the page.
  3. 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=None or 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.

IvanPisquiy06 avatar Mar 13 '26 01:03 IvanPisquiy06

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.

IvanPisquiy06 avatar Mar 13 '26 01:03 IvanPisquiy06

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.

cdrini avatar Mar 13 '26 02:03 cdrini

Default for this view should be 100; high enough for most series, low enough to avoid performance issues.

mekarpeles avatar Mar 13 '26 05:03 mekarpeles