Skip to content

Conversation

@Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Aug 26, 2025

The GET /summary call correctly initialized the newest_version fields of the crates, but when navigating to the crate page, the GET /crate/foo call by default uses an include query parameter that excludes the newest_version field from being loaded on the backend, which causes it to be returned with a value of 0.0.0 (for legacy reasons). This then reset the field on the model, causing it to be displayed incorrectly when navigating back to the front page.

This commit fixes the issue by adjusting the crate serializer to ignore 0.0.0 values for max_version and newest_version, so that they won't override previously loaded values.

Resolves #11772

@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-frontend 🐹 labels Aug 26, 2025
@Turbo87 Turbo87 force-pushed the newest-version-reset branch from c6744c4 to f8f0a5a Compare August 26, 2025 14:10
The `GET /summary` call correctly initialized the `newest_version` fields of the crates, but when navigating to the crate page, the `GET /crate/foo` call by default uses an `include` query parameter that excludes the `newest_version` field from being loaded on the backend, which causes it to be returned with a value of `0.0.0` (for legacy reasons). This then reset the field on the model, causing it to be displayed incorrectly when navigating back to the front page.

This commit fixes the issue by adjusting the crate serializer to ignore `0.0.0` values for `max_version` and `newest_version`, so that they won't override previously loaded values.
@Turbo87 Turbo87 force-pushed the newest-version-reset branch from f8f0a5a to 4b5d091 Compare August 26, 2025 17:33
@Turbo87 Turbo87 merged commit 9857ef0 into rust-lang:main Aug 27, 2025
11 checks passed
@Turbo87 Turbo87 deleted the newest-version-reset branch August 27, 2025 09:04
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 this pull request may close these issues.

Crates in "New Crates" and "Just Updated" sections on homepage display version v0.0.0 after navigating back from crate details page

1 participant