GET /api/v2/paperdex times out on unfiltered requests #102
Labels
No Label
ai-changes-requested
ai-failed
ai-merged
ai-pr-opened
ai-reviewed
ai-reviewing
ai-reviewing
ai-working
bug
enhancement
evolution
performance
phase-0
phase-1a
phase-1b
phase-1c
phase-1d
security
tech-debt
todo
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-database#102
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
GET /api/v2/paperdex(no filters) times out and never returns. Confirmed on2026.3.2— pre-existing, not a regression from the 2026.3.17 release.Reproduction
Root Cause (suspected)
get_paperdexinapp/routers_v2/paperdex.pydoes two full-table operations before any filters are applied:all_dex.count()— runs aCOUNT(*)across the entirepaperdextable before filtersmodel_to_dict(x, recurse=True)— serializes every nested relation for every rowThe
paperdextable is likely large enough that the unfiltered count + full serialization loop exceeds the nginx proxy timeout.Fix
count()call after filters are applied (or remove it — the response already returnscount: len(items))limitparameter (e.g. default 500) to prevent unbounded result setsPR #103 opened: #103
Fix approach:
all_dex.count()call (was a full-tableCOUNT(*)before anyWHEREclauses)limitparameter (default 500) applied after all filters to cap result setslist(all_dex)and usedlen()for the count field — eliminates the secondCOUNT(*)query