From 9a15fd3d6fde771ff1479956449e6b25005c6aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-X=2E=20T=2E?= Date: Mon, 5 Oct 2026 10:42:46 -0400 Subject: [PATCH 1/3] chore: tweak medal offer --- apps/labrinth/src/routes/internal/medal.rs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/labrinth/src/routes/internal/medal.rs b/apps/labrinth/src/routes/internal/medal.rs index c443e19e75f..17a4a2e28b7 100644 --- a/apps/labrinth/src/routes/internal/medal.rs +++ b/apps/labrinth/src/routes/internal/medal.rs @@ -29,7 +29,7 @@ struct VerifyResponse { redeemed: bool, } -/// Verify Medal credentials. +/// Verify Medal credentials. #[utoipa::path( context_path = "/medal", tag = "medal", @@ -40,6 +40,11 @@ pub async fn verify( pool: web::Data, web::Query(MedalQuery { username }): web::Query, ) -> Result { + return Err(ApiError::Request(eyre::eyre!( + "This offer is not available anymore" + ))); + + /* let maybe_fields = RedeemalLookupFields::redeemal_status_by_username_and_offer( &**pool, @@ -56,9 +61,10 @@ pub async fn verify( redeemed: fields.redeemal_status.is_some(), })), } + */ } -/// Redeem Medal credit. +/// Redeem Medal credit. #[utoipa::path( context_path = "/medal", tag = "medal", @@ -66,13 +72,18 @@ pub async fn verify( )] #[post("/redeem", guard = "medal_key_guard")] pub async fn redeem( - pool: web::Data, - redis: web::Data, - web::Query(MedalQuery { username }): web::Query, + _pool: web::Data, + _redis: web::Data, + web::Query(MedalQuery { username: _ }): web::Query, ) -> Result { // Check the offer hasn't been redeemed yet, then insert into the table. // In a transaction to avoid double inserts. + return Err(ApiError::Request(eyre::eyre!( + "This offer is not available anymore" + ))); + + /* let mut txn = pool .begin() .await @@ -131,4 +142,5 @@ pub async fn redeem( } else { Ok(HttpResponse::Created().finish()) } + */ } From 0acf808f680aae3b8ccb9019b3c16941f967bfc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-X=2E=20T=2E?= Date: Mon, 5 Oct 2026 17:39:00 -0400 Subject: [PATCH 2/3] tweak copy --- apps/labrinth/src/routes/internal/medal.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/labrinth/src/routes/internal/medal.rs b/apps/labrinth/src/routes/internal/medal.rs index 17a4a2e28b7..6486dc9876f 100644 --- a/apps/labrinth/src/routes/internal/medal.rs +++ b/apps/labrinth/src/routes/internal/medal.rs @@ -41,7 +41,7 @@ pub async fn verify( web::Query(MedalQuery { username }): web::Query, ) -> Result { return Err(ApiError::Request(eyre::eyre!( - "This offer is not available anymore" + "This offer is no longer available" ))); /* @@ -80,7 +80,7 @@ pub async fn redeem( // In a transaction to avoid double inserts. return Err(ApiError::Request(eyre::eyre!( - "This offer is not available anymore" + "This offer is no longer available" ))); /* From 610a9c135f2112cd752d600987d9b04afc99a492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-X=2E=20T=2E?= Date: Mon, 5 Oct 2026 18:05:17 -0400 Subject: [PATCH 3/3] fix: clippy lints in disabled medal routes Co-Authored-By: Claude Opus 5.5 --- apps/labrinth/src/routes/internal/medal.rs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/apps/labrinth/src/routes/internal/medal.rs b/apps/labrinth/src/routes/internal/medal.rs index 6486dc9876f..ae61c6ac121 100644 --- a/apps/labrinth/src/routes/internal/medal.rs +++ b/apps/labrinth/src/routes/internal/medal.rs @@ -1,15 +1,8 @@ use crate::database::PgPool; -use crate::util::error::Context as _; use actix_web::{HttpResponse, post, web}; use ariadne::ids::UserId; -use chrono::Utc; use serde::{Deserialize, Serialize}; -use tracing::warn; -use crate::database::models::users_redeemals::{ - Offer, RedeemalLookupFields, Status, UserRedeemal, -}; -use crate::queue::billing::try_process_user_redeemal; use crate::routes::ApiError; use crate::util::guards::medal_key_guard; use xredis::RedisPool; @@ -20,6 +13,7 @@ pub fn config(cfg: &mut actix_web::web::ServiceConfig) { #[derive(Deserialize)] struct MedalQuery { + #[expect(dead_code, reason = "medal offer is currently disabled")] username: String, } @@ -37,12 +31,12 @@ struct VerifyResponse { )] #[post("/verify", guard = "medal_key_guard")] pub async fn verify( - pool: web::Data, - web::Query(MedalQuery { username }): web::Query, + _pool: web::Data, + web::Query(MedalQuery { username: _ }): web::Query, ) -> Result { - return Err(ApiError::Request(eyre::eyre!( + Err(ApiError::Request(eyre::eyre!( "This offer is no longer available" - ))); + ))) /* let maybe_fields = @@ -79,9 +73,9 @@ pub async fn redeem( // Check the offer hasn't been redeemed yet, then insert into the table. // In a transaction to avoid double inserts. - return Err(ApiError::Request(eyre::eyre!( + Err(ApiError::Request(eyre::eyre!( "This offer is no longer available" - ))); + ))) /* let mut txn = pool