Skip to content

fix: ensure initial download route is normalized - #9247

Merged
MattIPv4 merged 3 commits into
mainfrom
MattIPv4/normalize-initial-download-route
Oct 30, 2026
Merged

MattIPv4 merged 3 commits into
mainfrom
MattIPv4/normalize-initial-download-route

Conversation

@MattIPv4

@MattIPv4 MattIPv4 commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

While investigating #9244, I realised the current logic allowed for direct navigation to /download/current where it'd show an LTS release, rather than a Current release, at the wrong path. This logic change now ensures that the path is normalized one first load, so that navigating to /download/current redirects the user to /download as there is no Current release available currently.

Validation

Access /download/current, redirected to /download. Access /download/alpha, no redirect.

Related Issues

cc #9223

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@MattIPv4
MattIPv4 requested a review from a team as a code owner October 29, 2026 20:58
Copilot AI balanced review requested due to automatic review settings October 29, 2026 20:58
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Oct 30, 2026 12:19am UTC

Request Review

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.16%. Comparing base (b86c448) to head (b864cdf).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...e/components/Downloads/Release/VersionDropdown.tsx 93.75% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9247      +/-   ##
==========================================
+ Coverage   86.14%   86.16%   +0.01%     
==========================================
  Files          87       87              
  Lines        6149     6164      +15     
  Branches      369      369              
==========================================
+ Hits         5297     5311      +14     
- Misses        848      849       +1     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the changes aligning download URLs with the displayed release.

No open issues 🎉

What changed in this PR

This PR keeps download URLs consistent with the displayed release on initial load. When no Current release is available, visiting /download/current redirects to /download rather than showing an LTS release at the Current URL.

Changes:

  • Shares release-status routing logic between initial rendering and version selection.
  • Adds tests for initial route normalization and stateful version changes.
File Description
apps/​site/​components/​Downloads/​Release/​VersionDropdown.tsx Normalizes the initial route and reuses redirect logic for version selection.
apps/​site/​components/​Downloads/​Release/​__tests__/​VersionDropdown.test.jsx Tests initial redirects and verifies selection behavior with state updates.

Review effort: Balanced

@MattIPv4

Copy link
Copy Markdown
Member Author

Lol what, codecov is angry that the tests don't cover a type import??

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 7.21 MB
New Total First Load JS 7.21 MB
Delta 2.78 KB (+0.04%)

Changes

🔄 Modified Routes (4)
Route Old First Load JS New First Load JS Delta
/[locale] 1.69 MB 1.69 MB 📈 711.00 B (+0.04%)
/[locale]/[...path] 1.69 MB 1.69 MB 📈 711.00 B (+0.04%)
/[locale]/blog/[...path] 1.69 MB 1.69 MB 📈 711.00 B (+0.04%)
/[locale]/download/archive/[version] 1.69 MB 1.69 MB 📈 711.00 B (+0.04%)

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote my last nit, just to make the code a bit easier to read. After that LGTM!

@MattIPv4

Copy link
Copy Markdown
Member Author

Happy to fast-track this as well, as another bug fix?

@ovflowd

ovflowd commented Oct 30, 2026 •

Copy link
Copy Markdown
Member
1754719861337

@ovflowd ovflowd added the fast-track Fast Tracking PRs label Oct 30, 2026
@MattIPv4
MattIPv4 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit bc4348d Oct 30, 2026
20 checks passed
@MattIPv4
MattIPv4 deleted the MattIPv4/normalize-initial-download-route branch October 30, 2026 01:04

This branch was successfully deployed

1 active deployment
Preview — b864cdf8 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-track Fast Tracking PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants