Skip to content

"Go to latest version" should ignore yanked versions #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kinrany opened this issue Aug 14, 2019 · 6 comments
Closed

"Go to latest version" should ignore yanked versions #396

Kinrany opened this issue Aug 14, 2019 · 6 comments

Comments

@Kinrany
Copy link

Kinrany commented Aug 14, 2019

Clicking "Go to latest version" at https://docs.rs/futures/0.1.28/futures/ opens the docs for version 0.2.3-docs-yank.4 and then redirects back to 0.1.28.

Expected behavior:
should open the latest non-yanked version, 0.2.1.
should not display "Go to latest version" since 0.1.28 is already the latest version;
for 0.1.27 should open 0.1.28 directly instead of opening the yanked version first.

Related: #112, #221

@Kinrany
Copy link
Author

Kinrany commented Aug 14, 2019

Yanked versions should be filtered from &crate_details.versions here:

let latest_version = latest_version(&crate_details.versions, &version);

@QuietMisdreavus
Copy link
Member

Would this get fixed by #322?

@Kinrany
Copy link
Author

Kinrany commented Aug 18, 2019

Would this get fixed by #322?

It's related: would allow replacing the snippet above with

let versions_without_yanked = &crate_details.versions
    .filter(|v| !&crate_details.yanked.contains(v));
let latest_version = latest_version(versions_without_yanked, &version);

@Kinrany
Copy link
Author

Kinrany commented Aug 18, 2019

Oh wait, yanked is a bool, not a list of yanked versions.

@Kinrany
Copy link
Author

Kinrany commented Aug 18, 2019

Still related. #396 (comment) would apply if you added yanked_versions to CrateDetails in addition to yanked.

@Nemo157
Copy link
Member

Nemo157 commented May 6, 2020

Should be fixed by #739, the futures crate is no longer a good testcase unfortunately, but there's internal tests covering it.

@Nemo157 Nemo157 closed this as completed May 6, 2020
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

No branches or pull requests

3 participants