Issues list Next button shows empty page when no label filter is active
Issues list "Next" button shows empty page when no label filter is active
Bug
Clicking Next → on the issues list page navigates to a page showing "No open issues" even though there are more issues to show.
Reproduction
- Open any repo's issues list with enough issues to paginate (> 25)
- Leave the label filter unset (the default "all" state)
- Click Next →
- Result: "No open issues" — the second page is empty
Root cause
The Next button preserves label= (empty string) in the URL when no label
is selected:
/gabriel/musehub/issues?state=open&label=&sort=newest&cursor=...&limit=25
In ui_issues.py, the empty string is passed directly to list_issues:
_filtered_resp = await musehub_issues.list_issues(
db, repo_id, state=state, label=label, limit=10000
)
list_issues checks if label is not None — an empty string passes that
guard — and executes:
WHERE '' = ANY(labels)
No issue has an empty-string label, so the query returns zero results. The page renders as empty regardless of what cursor was passed.
Fix
One line in ui_issues.py — treat empty string the same as no filter:
_filtered_resp = await musehub_issues.list_issues(
db, repo_id, state=state, label=label or None, limit=10000
)
The same or None guard should be applied to the open/closed count fetches
on the same route if they also forward the label parameter.
Affected file
musehub/api/routes/musehub/ui_issues.py — list_issues route handler