fix: resolve 330+ backend compilation errors#149
Open
GazzyLee wants to merge 10 commits into
Open
Conversation
|
@Gazzy-Lee is attempting to deploy a commit to the paul joseph's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
CI isn't passing |
|
@GazzyLee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
fix merge conflicts, please |
Contributor
|
We still have merge conflicts @GazzyLee |
1875523 to
51b80be
Compare
…me sqlx, upstream logic)
- Add explicit type annotations to Redis calls to fix never-type fallback errors (Rust 2024 compat): query_async::<()>, set_ex::<_,_,()>, del::<_,()>, sadd::<_,_,()>, expire::<_,()>, incr::<_,_,()> in jwt_service.rs and device_service.rs - Add #[derive(Clone)] to JwtService (required by AuthService derive) - Fix Option<String> Display in auth_handler.rs info! macro - Fix Option<i64> vs i64 comparison in tournament_service.rs - Fix i32/usize type mismatch in tournament bracket generation - Remove #[validate(range)] from Decimal fields (validator crate doesn't support rust_decimal::Decimal for ValidateRange) - Make validate_transition pub(crate) for test access - Make CreateNotificationRequest pub (private type in public API error)
- Run cargo fmt --all to fix formatting across 7 files - Fix ~143 clippy warnings via cargo clippy --fix (redundant closures, unused imports/vars) - Add #[allow(dead_code)] to crate roots (WIP services not yet wired to routes) - Add #[allow(dead_code)] to deserialization structs in soroban_service/stellar_service - Convert DeviceType ToString impl to Display (clippy::to_string_trait_impl) - Factor complex tuple type into type alias in device_service - Fix always-true assertions in tests - Add #[allow(clippy::too_many_arguments)] to record_transaction - Remove unused sqlx::Row import from match_authority_service All three CI checks now pass locally: cargo fmt --all -- --check (exit 0) cargo clippy --all-targets -- -D warnings (exit 0) cargo build --all-targets (exit 0)
…ompose, and contracts README
- Convert sqlx::query!/query_as! macros to runtime queries (no .sqlx offline cache) - Fix Claims.user_id -> Claims.sub with Uuid::parse_str - Fix PgRow field access to use try_get() - Fix Option<i32> unwrapping for ELO calculations - Fix double-Option on average_wait_time - Add local ApiResponse in reputation_handler - Add leave_queue() public method to MatchmakerService - Fix moved value and Redis never-type fallback in matchmaker
6d0958e to
e4ec44e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves 330+ backend compilation errors by converting all SQLx compile-time macros to runtime query equivalents, fixing type conflicts, updating deprecated Redis APIs, and resolving Rust 2024 compatibility issues — verified with
cargo buildpassing locally.Type of change
Related issues
Closes #128
Changes
sqlx::query!()/sqlx::query_as!()compile-time macros withsqlx::query()/sqlx::query_as::<_, T>()using.bind()chains — eliminates the need forDATABASE_URLat compile timeauth_service.rs— full rewrite (~25 queries)match_service.rs— recreated from scratch (~40 queries: matchmaking, ELO, scores, disputes, leaderboard)governance_service.rs— 5 macros convertedwallet_service.rs— 12 macros convertedstellar_service.rs— 4+ macros converted::<()>type annotations to all Redis calls (query_async,set_ex,del,sadd,expire,incr) in jwt_service.rs and device_service.rspub type DbPool = Arc<PgPool>inwallet_service.rsandstellar_service.rs; unified oncrate::db::DbPoolget_async_connection()withget_multiplexed_async_connection()in device_service.rs (3 call sites)#[derive(Clone)]toJwtService,sqlx::TypetoPaymentProviderenumOption<i64>vsi64comparison andi32/usizemismatch in tournament_service.rs#[validate(range)]fromDecimalfields (validator crate doesn't supportrust_decimal::Decimal)validate_transitionpub(crate)for test access, madeCreateNotificationRequestpubpub mod auth_serviceinservice/mod.rs,pub mod auth_handlerinhttp/mod.rs,mod modelsinmain.rs, test modules inauth/mod.rsandservice/mod.rsOption<String>Display fix: Used.as_deref().unwrap_or("none")in auth_handler.rs tracing macroDbPool::default()withPgPoolOptions::connect_lazy()in test helpersauth_service_updated.rsandmatch_model.rsbackendjob to.github/workflows/ci.ymlwithSQLX_OFFLINE=true(fmt check, build, clippy, test)Testing
cargo test/npm test)cargo testincontracts/)Checklist
.down.sqlexists)