fix: correctly exclude primary version from expanded tag list#1802
fix: correctly exclude primary version from expanded tag list#1802danielroe merged 1 commit intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThe pull request updates the Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
🔗 Linked issue
Resolves #1789
🧭 Context
When expanding a dist-tag row, versions newer than the dist-tag version could be silently dropped when the dist-tag does not point to the latest version in its major.
📚 Description
Taking
@types/nodeas an example,ts5.1 -> 24.1.0, but the latest24.xis24.11.0.channelVersionsis sorted by semver descending, so[0]is always the newest version in the channel, not the dist-tag version:The old code used
.slice(1)to exclude the primary version from the expanded list, assuming[0]was always the primary version. This assumption only holds when the dist-tag points to the latest version in its major.The fix replaces
getFilteredTagVersions+.slice(1)withgetExpandedTagVersions, which filters out the primary version by version string match instead of by array position.