Skip to content
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

The crate view page is empty when the only difference to a published crate is - vs _ #10368

Closed
cyrgani opened this issue Jan 10, 2025 · 7 comments · Fixed by #10369
Closed

The crate view page is empty when the only difference to a published crate is - vs _ #10368

cyrgani opened this issue Jan 10, 2025 · 7 comments · Fixed by #10369
Labels
A-frontend 🐹 C-bug 🐞 Category: unintended, undesired behavior

Comments

@cyrgani
Copy link

cyrgani commented Jan 10, 2025

Current Behavior

Documentation pages for nonexistent crates like serde-json or proc_macro2, where the only difference in the name is that _ was used but the crate name uses - (and the other way around) do not contain a 404 info (serde-json: Crate not found)
and are empty, compared to a non-existing crate that works fine.

Expected Behavior

A 404 message like for other non-existing crates or ideally also a note that a similar crate with different usage of - or _ exists.

Steps To Reproduce

  1. Go to https://crates.io/crates/serde-json
  2. See the (absence of the) error.

Environment

  • Browser: Chrome 131.0.6778.264, Firefox 134
  • OS: Linux Mint 22

Anything else?

No response

@Turbo87
Copy link
Member

Turbo87 commented Jan 10, 2025

@eth3lbert could this be caused by one of your latest refactorings? the API call seems to return the right thing, but the frontend then crashes afterwards.

@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-frontend 🐹 labels Jan 10, 2025
@eth3lbert
Copy link
Contributor

Thank you for the report. I will look into this as soon as I get back to my computer.

@cyrgani
Copy link
Author

cyrgani commented Jan 10, 2025

Another case I just encountered while looking at rust-lang/cargo#2775 which causes the browser to hang and slowly causes OOM, which is probably related:
https://crates.io/crates/serde-codegen

@eth3lbert
Copy link
Contributor

@eth3lbert could this be caused by one of your latest refactorings? the API call seems to return the right thing, but the frontend then crashes afterwards.

I just bisected a bit and it seems it failed at HEAD is now at bbe5345 Update dependency ember-data to v5 (#10355) 😅

After upgrading, the name requested (serde-json) and the name received (serde_json) in the response don't match, it results in another dangling crate with no versions.

Before:

Image

After:

Image

@Turbo87
Copy link
Member

Turbo87 commented Jan 10, 2025

argh okay... I wonder if using queryRecord() instead of findRecord() would fix this 🤔

in any case, we should probably add a test case for this 😅

@eth3lbert
Copy link
Contributor

I guess we could just redirect to the route with correct name?

@Turbo87
Copy link
Member

Turbo87 commented Jan 10, 2025

I've opened a PR to fix it: #10369

I guess we could just redirect to the route with correct name?

unfortunately this appears to be non-trivial to implement at first glance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants