Skip to content

always derive mrpack_loaders from dependencies in modrinth.index.json - #8360

Open
Prospector wants to merge 1 commit into
mainfrom
prospector/fix-mrpack-loaders
Open

Prospector wants to merge 1 commit into
mainfrom
prospector/fix-mrpack-loaders

Conversation

@Prospector

@Prospector Prospector commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@mergify

mergify Bot commented Nov 17, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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.

Summary

The PR derives mrpack_loaders from dependencies in uploaded .mrpack files.

  • Modpack versions get their loader from the uploaded pack.
  • Edits no longer set modpack loaders by hand.

Reviews (1) · Last reviewed commit: "fix mrpack loaders on backend, always de..." · Reviewed by Greptile

Comment on lines +972 to +981
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 _

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant