Skip to content

fix: don't rely on pkg.updated for update date#561

Merged
danielroe merged 1 commit intonpmx-dev:mainfrom
wojtekmaj:bs-updated
Jan 31, 2026
Merged

fix: don't rely on pkg.updated for update date#561
danielroe merged 1 commit intonpmx-dev:mainfrom
wojtekmaj:bs-updated

Conversation

@wojtekmaj
Copy link
Contributor

Fixes #535

It appears that the dates in updated field are not reliable at all (see #535 for details). Therefore I removed it and left only package.date, and now I get the exact results that I expected.

Fixes npmx-dev#535

It appears that the dates in `updated` field are not reliable at all (see npmx-dev#535 for details). Therefore I removed it and left only `package.date`, and now I get the exact results that I expected.
Copilot AI review requested due to automatic review settings January 31, 2026 21:33
@vercel
Copy link

vercel bot commented Jan 31, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jan 31, 2026 9:34pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Jan 31, 2026 9:34pm
docs.npmx.dev Skipped Skipped Jan 31, 2026 9:34pm

Request Review

@wojtekmaj
Copy link
Contributor Author

CC @serhalp, original author of #211, would love to get your approval on this before proceeding.

@danielroe
Copy link
Member

yes, I spotted this as well - thank you ❤️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where the "recently updated" sorting feature was not working correctly due to unreliable data in the updated field. The fix removes all dependencies on the pkg.updated field and uses only package.date for all update-related operations.

Changes:

  • Removed reliance on the unreliable result.updated field from npm search results
  • Updated all sorting and filtering logic to use package.date exclusively
  • Simplified date handling by eliminating fallback chains that included updated

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
app/pages/~[username]/index.vue Updated sorting logic to use only package.date instead of falling back to updated
app/composables/useStructuredFilters.ts Removed updated field references in both filtering and sorting functions
app/components/PackageTableRow.vue Simplified date display logic to use only package.date

@danielroe danielroe added this pull request to the merge queue Jan 31, 2026
Merged via the queue into npmx-dev:main with commit 8081bb6 Jan 31, 2026
18 of 19 checks passed
@wojtekmaj wojtekmaj deleted the bs-updated branch January 31, 2026 21:58
@serhalp
Copy link
Member

serhalp commented Jan 31, 2026

Thank you for fixing this @wojtekmaj! 🤝

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.

Recently updated sorting doesn't work properly

3 participants