Redundant routes: /admin/ and /ui/ render the same content in hero_books #135
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_books#135
Loading…
Add table
Add a link
Reference in a new issue
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
In hero_books, the following two routes appear to render identical content:
http://[50c:2786:2581:b5fe:3::1]:9988/hero_books/admin/http://[50c:2786:2581:b5fe:3::1]:9988/hero_books/ui/These routes seem redundant. Additionally, the admin route should likely be prefixed appropriately (e.g.,
admin_ui).Expected behavior: Clarify whether both routes are necessary. If they are redundant, consolidate them into a single route or differentiate their purposes clearly. The admin interface should use a consistent, properly prefixed route.
Root cause: this is a
hero_routerrouting behavior, not duplicate UIs in hero_books. The two binaries actually serve different pages — the router is collapsing both routes onto the admin socket.Verified by hitting the sockets directly (bypassing the router):
<title>hero_books/web.sock(hero_books_web, kind=web)hero_books/admin.sock(hero_books_admin, kind=admin)But through the router, both
/hero_books/ui/and/hero_books/admin/return the admin page (~15 KB, "Hero Books — Libraries"). The only difference between the two responses is the injected base path (BASE_PATH = "/hero_books/ui"vs"/hero_books/admin"); the markup is otherwise identical.Where it comes from
hero_router→crates/hero_router/src/server/routes.rs. Both path segments dispatch to the same resolver:resolve_ui_socket()resolves in priority order: a cache entry that isadmin.sock/ui.sock→<svc>/admin.sock→<svc>/ui.sock→<svc>/web.sock. Sinceadmin.sockexists it wins for both routes, andweb.sock(explicitly commented "legacy web-only") is never reached. So/ui/is effectively an alias of/admin/, and the publichero_books_webreader is unreachable through the router.Options
hero_books_webbinary — itsweb.sockis unroutable through the router anyway — so only/admin/(plus its/ui/alias) exist.hero_routerso/ui/→web.sockand/admin/→admin.sockresolve distinctly (and rename the admin route, e.g.admin_ui, per the description).Since the redundancy originates in
hero_router, the fix most likely belongs there — consider moving or cross-linking this issue tohero_router.(Investigated on devbox; hero_books debug build; router instance at
[50c:2786:2581:b5fe:3::1]:9988.)