Repository navigation
always derive mrpack_loaders from dependencies in modrinth.index.json - #8360
Prospector wants to merge 1 commit into
Conversation
…n modrinth.index.json
Pull request changelogAppAddedChangedDeprecatedRemovedFixedSecurityWebsiteAddedChangedDeprecatedRemovedFixedSecurityHostingAddedChangedDeprecatedRemovedFixedSecurity |
|
Tick the box to add this pull request to the merge queue (same as
|
[Medium impact] The change reaches modpack version creation, uploads, edits, and loader metadata in both API generations. Fix the upload write before merging so it cannot undo saved compatibility changes.
|
| component.mrpack_loaders = mrpack_loaders; | ||
| let component = component.clone(); | ||
| sqlx::query!( | ||
| r#" | ||
| UPDATE versions | ||
| SET components = jsonb_set(COALESCE(components, '{}'::jsonb), '{minecraft_mod}', $2::jsonb) | ||
| WHERE id = $1 | ||
| "#, | ||
| version_id as crate::database::models::ids::DBVersionId, | ||
| sqlx::types::Json(component) as _ |
There was a problem hiding this comment.
Uploads undo saved compatibility edits
The upload reads version before receiving the files, then writes the whole saved minecraft_mod back after changing only mrpack_loaders. If a teammate saves game_versions or environment during the upload, this write silently restores the older values. Update only mrpack_loaders in the database instead of replacing the whole component.
Knowledge Base Used: Project and version workflows
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/labrinth/src/routes/v3/version_creation.rs
Line: 972-981
Comment:
**Uploads undo saved compatibility edits**
The upload reads `version` before receiving the files, then writes the whole saved `minecraft_mod` back after changing only `mrpack_loaders`. If a teammate saves `game_versions` or `environment` during the upload, this write silently restores the older values. Update only `mrpack_loaders` in the database instead of replacing the whole component.
**Knowledge Base Used:** [Project and version workflows](https://app.greptile.com/-/switch-tenant?tenant=modrinth&next=%2Fcustom-context%2Fknowledge-base%2Fmodrinth%2Fcode%2F-%2Fdocs%2Fbackend-project-version-workflows.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
No description provided.