Skip to content

Preview reading lists a few per request - #1059

Merged
ajslater merged 1 commit into
developfrom
reading-list-preview-batches
Nov 26, 2026
Merged

ajslater merged 1 commit into
developfrom
reading-list-preview-batches

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Bug

A user previewing 63 lists in Admin → Reading Lists → Add saw the Preview 63 button lose its spinner and reset before the preview finished, while the server logs showed it still fetching lists afterward. 34 lists worked.

Cause

The dialog sent every picked list in one POST /admin/reading-lists/preview, and the server fetches, parses and matches each list before answering, so the request took longer the more lists were picked. Codex itself has no request timeout (not Granian, Django or xior). Something in front of it, a reverse proxy or the browser, dropped the connection, often after 60s idle. The fetch was rejected and the button reset, but the server kept working.

Fix

add-lists-dialog.vue now:

  • sends the picks 5 per request, one request at a time (files first, then sources), and shows every card together at the end, as before;
  • shows Previewed N of M lists… in the footer while it works;
  • stops asking for more batches when the dialog closes. A stale run neither shows its cards nor turns off the spinner of a newer one.

The server is unchanged except for a docstring line on the preview view saying why the dialog batches.

Notes for review

  • On this dev database, 15 real DieselTech catalog lists previewed as three 5-list requests in 1.2–1.8s each (~0.3s a list). The reporter's install looks 3–6× slower per list, which matches 34 fitting under 60s and 63 not. 5 a list per request leaves a wide margin.
  • A request that fails partway still shows no cards and gives an error notice, as before, rather than show part of the lists with no sign that some are missing.
  • No NEWS entry; it goes on the release PR. Suggested line: "Previewing many reading lists at once no longer gives up before it finishes."
  • Not clicked through in a browser. Covered by four new vitest cases: batch sizes 5/5/2, files in their own requests, progress text mid-preview, closing stops further requests.

Checks

  • make fix, make lint: clean
  • make test: 1469 frontend and 2891 Python tests pass, 2 skipped

🤖 Generated with Claude Code

The Add Reading Lists dialog sent every picked list in one preview
request, and the server fetches and matches each list before it
answers. With dozens of lists the request outlasted the idle timeout
of a proxy or browser in front of Codex (often 60s): the button reset
while the server kept fetching. 34 lists previewed, 63 did not.

The dialog now sends five lists per request, one request at a time,
shows "Previewed N of M lists…" while it works, and stops asking for
more when it is closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit d4f4c51 into develop Nov 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant