fix: add normalization for repeatable parameters - #4137
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe routing implementation adds normalization for repeatable route parameters. It removes trailing empty array elements and preserves interior empty elements before named localized route resolution. The routing tests add configurable route records and trailing-slash behavior, then cover catch-all routes, locale switching, URL queries and hashes, route consistency, and canonical trailing-slash URLs. Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change normalizes trailing empty repeatable route parameters to prevent duplicate slashes in localized URLs; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
UPD: The PR which resolves the same issue #4136 I kept this open for reference and just in case. Maintainers can close it if they find it unuseful. |
🔗 Linked issue
Resolves #4135
📚 Description
With
trailingSlash: true, route localiztion creates:Vue Router parses it like:
Then
switchLocalePath()copies those params into the localized named route. Vue Router joins the array astest/, then the localized route pattern adds its configured slash, so basically happens:Navigating there produces another empty parameter element, so the process repeats indefinitely.
The malformed SEO URLs are a downstream symptom: locale head generation calls switchLocalePath() for canonical and alternate URLs.
Solution
normalizeRepeatableParams), which removes only trailing empty elements from repeatable route params before named-route resolution.Summary by CodeRabbit