fix(browser): an unresolvable collection redirects to the top, not its bare root - #957
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:breadcrumbs.vuehides the last crumb because it's the current view, and its "Top" fallback only fires whenparentIdsexist, 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.changedrefresh probes/head, the count changes, and the page reloads. The full ACL resolves throughcomic__, so the emptied group no longer resolves, and the redirect (added in #902) sent the user to/series.Change
_raise_unresolved_collection_redirectnow reuses_get_up_page_redirect()frompage_in_bounds.py, the same target the out-of-bounds page redirect already uses:publisherswith no parent ids) for the publisher hierarchy and comics,Tests
test_a_pk_that_names_nothing_redirects_to_the_top: now expectspublishersinstead ofseries.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.folders.make fix,make lint,make tyandmake testall pass: Python 1569 passed (1 xfailed), frontend 940 passed./series/999999lands on/publisherswith Top Collection "Publishers".Reviewer notes
make lintreports tworeportUnreachablewarnings incodex/views/browser/annotate/cover.py. That file isn't touched here; the warnings were already there.clearFilters(true)skips_validateSearch), andloadSavedSettingsdropping its redirect.🤖 Generated with Claude Code