fix: redirect every pre-2.0.0 route path, not just the linked three (#85491) - #264
Merged
Merged
Conversation
…#85491) 2.0.1 only redirected the three paths other apps build links from. Bookmarks are the larger consumer and they are not trackable, so /asset, /author/12 and every other pre-2.0.0 path still landed on the not-found page — reported from devel on /asset. The shim is now a table of the 20 renamed roots, forwarding whatever follows. The rename went one level deeper for podcast and video-show episodes (episode -> episodes), so path segments are rewritten too. Paths 2.0.0 left alone (/login, /logout, /settings, /close-page, /unauthorized) are not touched. Verified by deriving the pre-2.0.0 path of every route in the generated typed-router.d.ts and navigating a memory-history router: 59 legacy paths, all landing on the matching current route with params, query and hash preserved, none falling through to the catch-all.
Merged
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.
Reported from devel:
https://admin-dam.smedevel.sk/assetrenders the not-found page.2.0.1 redirected only the three paths other apps build links from (
/asset/:id,/asset/file/:id,/user/:id/edit). Bookmarks are the larger consumer and they cannot be enumerated, so every otherpre-2.0.0 path — a plain
/asset, an/author/12— still fell through to[...pathMatch].vue.The shim is now a table of the 20 renamed roots that forwards whatever follows. The rename went one
level deeper for podcast and video-show episodes (
episode→episodes), so path segments arerewritten as well. Paths 2.0.0 left alone (
/login,/logout,/settings,/close-page,/unauthorized) are not touched.Still temporary — the TODO in
src/router/legacyRedirects.tsnames the link sources that have tochange before it can be deleted.
Verification
yarn lintclean (vue-tsc, oxlint, eslint, stylelint).typed-router.d.tsand navigated amemory-history router: 59 legacy paths, 0 failures, each landing on the matching current route.
Query and hash survive (
/asset/abc?tab=meta#roi→/assets/abc?tab=meta#roi), nested renameswork (
/podcast/7/episode/9/edit→/podcasts/7/episodes/9/edit), and/login//logout//settings/keywordsare not swallowed by the/logand/settingsneighbours.Released as 2.0.2 — see
doc/changelog/2.0.2.md.