metacpan-api icon indicating copy to clipboard operation
metacpan-api copied to clipboard

Deleted modules still linked to from user favorites

Open osfameron opened this issue 9 years ago • 4 comments

For example, https://metacpan.org/author/FIBO links to https://metacpan.org/release/PNI which is 404

osfameron avatar Mar 05 '15 18:03 osfameron

Part of the issue here is that we're allowing orphan favorites to live forever. See http://api.metacpan.org/favorite

Once a distribution no long has any modules with a status of "latest", we should prune those favourites. Either that or we should hide them. Probably just pruning them makes the most sense.

We should have a script that will audit every entry in the favorite type and delete orphan entries. We should also delete entries for users which may no longer exist as this may also be a problem.

oalders avatar Jun 30 '15 22:06 oalders

So, basically if there is no release for this distribution with a status of "latest", then associated favorites should be dropped. https://explorer.metacpan.org/#/f3aee41c8dcceba87813 is an example of what a release on BackPAN might look like.

Before we tackle this, we should consider if we do want to drop these. What could go wrong? We don't want to remove favorites if by some indexing error there is no longer a "latest" for a given distribution (like perl). So, probably we need to refine this a bit.

oalders avatar Jun 30 '15 22:06 oalders

Another option would be to handle this on the rendering side and just not link to the favorite which points to a distribution that no longer exists. This keeps the data as "once favorited" and allows it to work again if an indexing failure happens.

tsibley avatar Nov 17 '16 17:11 tsibley

That is exactly the way I patched the metacpan-web to filter out "no latest" distros: https://github.com/metacpan/metacpan-web/pull/1609 I think @oalders didn't merged in the mainline because I hadn't the time to re-base...I'll try to make it so in the near future.

markoong avatar Nov 22 '16 00:11 markoong