From 15c31f04a37d56f3f36d85a4c64c2379eeaed5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= <7822554+AlexTMjugador@users.noreply.github.com> Date: Sun, 31 Aug 2025 19:59:22 +0200 Subject: [PATCH] tweak(labrinth): skip versions with unsupported loader fields on project-wide fields change (#4305) --- apps/labrinth/src/routes/v3/projects.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/labrinth/src/routes/v3/projects.rs b/apps/labrinth/src/routes/v3/projects.rs index 0886c9908..6632511e8 100644 --- a/apps/labrinth/src/routes/v3/projects.rs +++ b/apps/labrinth/src/routes/v3/projects.rs @@ -880,7 +880,7 @@ pub async fn project_edit( ) .await? { - super::versions::version_edit_helper( + match super::versions::version_edit_helper( req.clone(), (VersionId::from(version.inner.id),), pool.clone(), @@ -891,7 +891,16 @@ pub async fn project_edit( }, session_queue.clone(), ) - .await?; + .await + { + // An `InvalidInput` error being returned from this route when only + // editing the loader fields means that such fields are not valid for + // the loaders defined for this version, which is a common case for + // projects with heterogeneous loaders across versions and is best + // handled with opportunistic update semantics + Ok(_) | Err(ApiError::InvalidInput(_)) => continue, + err => return err, + } } }