A site cannot override an installed app's route for a role with an external route
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Start with runtime/routing/utils.ts, especially getUrlByRouteRole, and trace how resolveRouteByRole and getLinkProps use it. The issue describes precedence between app routes and externalRoutes but leaves the override behavior and duplicate-role reporting as design questions. Done means the issue's intended precedence is decided and role resolution follows it; the payload names no tests to run.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
An app that declares a route for a role always wins over the site's externalRoutes for that role, so a site cannot send a role an installed app declares to a destination of its own. Found while planning to move Learning's tab links onto route roles (openedx/frontend-app-learning#2190, part of #1905): once it does, an operator who wants Learning's dates or outline link to go somewhere else has no way to say so.
[!NOTE]
The details below were generated by Claude (Claude Code) and reviewed before posting.
Claude Plan
How a role resolves today
getUrlByRouteRolewalkssiteConfig.appsin list order and each app's route tree depth-first, and returns the first route whosehandle.rolesincludes the role. Only when no app declares the role does it readsiteConfig.externalRoutes, again first match. There is no check for a second match and no warning, so when two apps declare the same role the one listed first inappswins silently, and an external route for a role any app declares is never consulted.resolveRouteByRoleandgetLinkPropsbuild on it, so every link resolved through a role follows the same order.ExternalRouteis a role and a URL; nothing on it or on the site config says it should take precedence.
What the docs say
- The migration guide's URL Config changes: URLs "should now be expressed as part of the
appsconfig as route roles, or asexternalRoutes, and resolved in code viaresolveRouteByRole()". It names both sources and does not say what happens when both declare a role.
Where it bites
- Learning declares
org.openedx.frontend.role.courseDates,courseOutlineandcourseProgresson its routes, which it must for the shell's course bar. Its progress tab is to link to the dates and outline tabs through those roles (openedx/frontend-app-learning#2190). A site that then wants one of those links to go elsewhere cannot express that in site config: an external route for the role is never reached while Learning is installed. - The same holds for any app that declares a role for a page it serves and any site that wants to point that role elsewhere.
Questions
- Should a site be able to override an installed app's route for a role with a destination of its own, without uninstalling the app?
- If so, how does the site say so?
- Should the resolver report when two sources declare the same role?
- Lenguaje dominante
- TypeScript
- Estrellas
- 4
- Forks
- 13
- Merge medio
- 3 d 5 h
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openedx/frontend-base
-
Export `SkipLink` componentAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openedx/frontend-base#330 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
openedx/frontend-base#327 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
openedx/frontend-base#210 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
openedx/frontend-base#350 ·
-
External routes ignore paramsPosiblemente ocupada @arbrandes la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
openedx/frontend-base#349 · 1 asignado ·
Todos los issues de openedx/frontend-base
Issues similares
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openclaw/openclaw#200365 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
effort: small good first issue priority: medium testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
TMHSDigital/screencast-mcp#351 ·
Los mantenedores suelen responder en 1 día
-
area-templates triage:bot-seen triage:needs-human
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/aspire#22356 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Archiving an agent that is not loaded keeps its old updatedAtPosiblemente ocupada @luoph la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
content triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día