There was a very similar bug in crates.io two years ago and now it seems to have popped up on docs.rs too: https://github.com/rust-lang/crates.io/issues/1144
All the details are in that bug (just replace crates.io/crates with docs.rs), but I'll describe it here as well.
To reproduce the bug, go to https://docs.rs/turtle
Expected: This should redirect to the latest version: https://docs.rs/turtle/1.0.0-rc.3
Actual: You are taken to an old version: https://docs.rs/turtle/0.1.3
This doesn't happen for crates that already have a non-alpha/non-rc latest version (e.g. https://docs.rs/serde)
This was working until recently. Something must have changed in the last few weeks to cause this bug.
Interestingly, the "Go to latest version" link still appears and works as expected. It's just the version resolution for the URL that isn't working as expected anymore.
Update: Looking into it further, it seems to be an intentional change made as part of https://github.com/rust-lang/docs.rs/issues/223. So I guess the real bug is that yanked versions aren't being considered when we filter for the versions available. For example, for the turtle crate used in the steps above, all the non-alpha/non-rc versions are yanked. So docs.rs should choose the latest alpha/rc version instead of loading docs for a yanked version.
If docs.rs doesn't currently deal with yanked crates, an easy workaround just for my particular case might be to delete the old non-1.0 versions of the turtle crate. I asked for that in https://github.com/rust-lang/docs.rs/issues/158 a few years ago, but I guess no one had a chance to get around to it.
This is a very strange bug to see, because we explicitly filter out yanked versions in the match_version query: https://github.com/rust-lang/docs.rs/blob/master/src/web/mod.rs#L231. Maybe we didn't store that the version was yanked for some reason?
Maybe these versions were published before that information started being stored?
This doesn't need to be fixed in code then I think, I can just write a one-off shell script.
Ah so the problem is we never update the yanked field :man_facepalming: This is #322
@jyn514 any update on this issue? Is there a way to fix this?
@sunjay see https://github.com/rust-lang/docs.rs/pull/322#issuecomment-617752747
with #739 yanked is now automatically updated for new crates, and @jyn514 has just imported missing yanks up to now, so https://docs.rs/turtle now redirects to the latest prerelease.
Thanks! This is awesome. Everything works really well now 馃槉