Incorrect latest tag when npm packages are published to multiple projects
Problem
When different package's versions are published to different projects the project's metadata contain incorrect latest
tag.
The screenshot below shows the case when the version 1.0.0
was published to the project with id 129
and the version 2.0.0
was published to the project with id 130
. The correct latest
tag in such case should be 2.0.0
, but it's 1.0.0
Solution
We could change the Packages::TagsFinder
to accept either a project
or a namespace
as an argument during the initialization. Afterwards we could do a lookup for packages within a project or a namespace.
Also we need to change the Packages::Npm::CreateTagService
to call the Packages::TagFinder
with a namespace instead of project.
The last step will be to change the DELETE
npm tag endpoint to call the Packages::TagsFinder
with correctly passed project
.