berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug]: "last updated" in search is sometimes wrong

Open Araxeus opened this issue 2 years ago • 3 comments

Self-service

  • [ ] I'd be willing to implement a fix

Describe the bug

Package "last updated" might be updated when an external type package is linked or something?

it really shouldn't do that, "last updated" should only point to the latest released version of the package

(also it seems like the "last updated" value is only shown on search result page? can we agree that behavior is weird?

To reproduce

Search yarnpkg for "benchmark" https://yarnpkg.com/?q=benchmark&p=1 it shows it was last updated "4 months ago" image

the package (https://yarnpkg.com/package/benchmark) was last updated in 2017 (5 years ago) There is no mention of "4 months ago" or "2021" or "2022" on the package page

Important notes:

  • npm shows the correct date so I don't see any reason for yarn to deviate from that image

  • I'm guessing this might have to do with the fact that @types/benchmark was last updated at 'July 6, 2021' (even tho that's 9 months ago, so I really don't understand where the "4 months ago" came from)

Environment

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11600K @ 3.90GHz
  Binaries:
    Node: 17.8.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.6.0 - C:\Program Files\nodejs\npm.CMD

Additional context

  • I don't really have enough experience with react but this should be easy to fix, maybe just change both hit.modified to hit.versions[0].pubDate in HitLastUpdate

  • I'm not even sure how can a package be modified if a new version wasn't released?

sources: https://github.com/npm/registry https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md

https://github.com/yarnpkg/berry/blob/master/packages/gatsby/src/components/details/Versions.js https://github.com/yarnpkg/berry/blob/master/packages/gatsby/src/components/details/Aside.js https://github.com/yarnpkg/berry/blob/42d075894f0699378dd1d970991b99903b917403/packages/gatsby/src/components/hit/index.js#L329

Araxeus avatar Apr 03 '22 15:04 Araxeus

Hi! 👋

This issue looks stale, and doesn't feature the reproducible label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).

Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃

If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded label. Thanks for helping us triaging our repository! 🌟

yarnbot avatar May 03 '22 17:05 yarnbot

The npm registry says the package was modified at 2021-12-08T22:36:21.996Z https://registry.npmjs.com/benchmark, though perhaps we should show when the version was published instead.

merceyz avatar May 03 '22 18:05 merceyz

perhaps we should show when the version was published instead.

I think that would really be more clear since the real change date is when the version was published

This specific example really highlights the problem, it was published 5 years ago but when searching yarn's website it looks like it's a maintained package...

Araxeus avatar May 03 '22 18:05 Araxeus

Also important to note that NPM's website display the last published version, and not the last modified version (which once again, like said - is way more clear since the last modified version doesn't mean much)

Araxeus avatar Feb 21 '23 19:02 Araxeus