Skip to content

fix(browser): an unresolvable collection redirects to the top, not its bare root - #957

Merged
ajslater merged 1 commit into
developfrom
fix/unresolved-collection-redirects-to-top
Sep 29, 2026
Merged

ajslater merged 1 commit into
developfrom
fix/unresolved-collection-redirects-to-top

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Summary

A browse route whose collection pk resolves to nothing redirected to that collection's own bare root (e.g. /series), not the top collection's root. Under a Publishers top collection, that page is a dead end:

  • the backend sends only the root crumb,
  • breadcrumbs.vue hides the last crumb because it's the current view, and its "Top" fallback only fires when parentIds exist, so nothing shows,
  • / resumes the saved last route, which is now /series, so the user stays stuck until they switch top collections.

How it was hit

Tag a comic while viewing its series or volume. If the tag write moves the comic(s) elsewhere, the old group is left empty. The next library.changed refresh probes /head, the count changes, and the page reloads. The full ACL resolves through comic__, so the emptied group no longer resolves, and the redirect (added in #902) sent the user to /series.

Change

_raise_unresolved_collection_redirect now reuses _get_up_page_redirect() from page_in_bounds.py, the same target the out-of-bounds page redirect already uses:

  • the top collection's root (serialized as publishers with no parent ids) for the publisher hierarchy and comics,
  • the folders or story arcs root in those views, unchanged.

Tests

  • test_a_pk_that_names_nothing_redirects_to_the_top: now expects publishers instead of series.
  • test_an_emptied_volume_redirects_to_the_top: new. It moves a volume's only comic out, as a tag write would. Both of these fail on the old code and pass with the fix.
  • The stamped-folder test now also asserts the redirect stays in folders.
  • make fix, make lint, make ty and make test all pass: Python 1569 passed (1 xfailed), frontend 940 passed.
  • Checked by hand in the dev server: /series/999999 lands on /publishers with Top Collection "Publishers".

Reviewer notes

  • make lint reports two reportUnreachable warnings in codex/views/browser/annotate/cover.py. That file isn't touched here; the warnings were already there.
  • A separate follow-up covers two frontend paths that may reach the same stranded state: clearing a search with the empty-results "Clear Filters and Search" button (clearFilters(true) skips _validateSearch), and loadSavedSettings dropping its redirect.

🤖 Generated with Claude Code

…s bare root

A route whose collection pk resolves to nothing redirected to that
collection's own bare root. Under a Publishers top collection that is
`/series` (or `/volumes`) with no parent ids: the backend sends only
the root crumb, the client hides it as the current view, and `/`
resumes the saved last route, so the user is stranded until they
switch top collection.

A tag write that moves a series' or volume's comics elsewhere triggers
it on the next refresh: the ACL resolves through `comic__`, so the
emptied group no longer resolves.

Reuse `_get_up_page_redirect`, the out-of-bounds page redirect's
target: the top collection's root, or the folder / story arc root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit 722ca0d into develop Sep 29, 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