Skip to content

fix: redirect the pre-2.0.0 singular route paths (#85491) - #262

Merged
volarname merged 1 commit into
developfrom
fix/85491-legacy-route-redirects
Aug 17, 2026
Merged

fix: redirect the pre-2.0.0 singular route paths (#85491)#262
volarname merged 1 commit into
developfrom
fix/85491-legacy-route-redirects

Conversation

@volarname

Copy link
Copy Markdown
Contributor

2.0.0 pluralized every route path and added no redirect layer, so links to admin-dam held by other
apps 404. A search through common-admin and admin-cms turned up three paths that are still linked
from outside:

  • /asset/:id — built by DamAdminAssetLink.vue in common-admin, rendered by admin-cms (audio
    widget, audio/video embed dialogs), by common-admin itself (image detail dialog) and inherited by
    admin-ugc.
  • /asset/file/:id — asset-file detail, linked from an external library.
  • /user/:id/edit — admin-cms DAM_USER_EDIT_URL_TEMPLATE, opened by SystemUserEditButton.vue.
    Its value lives in .env, every developer's .env.local, the generated public/config.json and
    the deployment pipeline variables, so it outlives a single code change.

They are added with router.addRoute() and re-added inside the handleHotUpdate callback, because a
hot update replaces the generated routes and drops anything added at runtime. Redirect targets are
route names rather than paths, so the anzu-local/valid-route-name lint rule fails loudly if a
page file is renamed instead of the shim silently redirecting to a 404.

The shim is temporary — the TODO in src/router/legacyRedirects.ts lists what has to change before
it can be removed.

Verification

  • yarn lint clean (vue-tsc, oxlint, eslint, stylelint).
  • Navigated a memory-history router: all three legacy paths redirect to the plural path with params,
    query and hash preserved (/asset/abc?tab=meta#roi/assets/abc?tab=meta#roi), and the plural
    paths are unaffected.
  • nginx only special-cases ^/assets/?$, so the legacy paths fall through the default try_files to
    index.html and reach the SPA.

Released as 2.0.1 — see doc/changelog/2.0.1.md.

2.0.0 pluralized every route path and added no redirect layer, so links to
admin-dam held by other apps 404. A search through common-admin and admin-cms
turned up three paths that are still linked from outside:

- /asset/:id — built by DamAdminAssetLink.vue in common-admin, rendered by
  admin-cms (audio widget, audio/video embed dialogs), by common-admin itself
  (image detail dialog) and inherited by admin-ugc.
- /asset/file/:id — asset-file detail, linked from an external library.
- /user/:id/edit — admin-cms DAM_USER_EDIT_URL_TEMPLATE, opened by
  SystemUserEditButton.vue. Its value lives in .env, every developer's
  .env.local, the generated public/config.json and the deployment pipeline
  variables, so it outlives a single code change.

They are added with router.addRoute() and re-added inside the handleHotUpdate
callback, because a hot update replaces the generated routes and drops anything
added at runtime. Redirect targets are route names rather than paths so the
anzu-local/valid-route-name lint rule fails loudly if a page file is renamed,
instead of the shim silently redirecting to a 404.

Verified by navigating a memory-history router: all three redirect to the plural
path with params, query and hash preserved, and the plural paths are unaffected.

The shim is temporary; the TODO in src/router/legacyRedirects.ts lists what has
to change before it can be removed.
@volarname
volarname merged commit 27b425d into develop Aug 17, 2026
2 checks passed
@volarname
volarname deleted the fix/85491-legacy-route-redirects branch August 17, 2026 11:01
@volarname volarname mentioned this pull request Aug 17, 2026
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