[server] Replay leaderboard update is dead code — case mismatch "classic" vs "Classic" #14

Closed
opened 2026-05-19 18:43:04 +00:00 by funman300 · 0 comments
Owner

File

solitaire_server/src/replays.rs line 119

Description

GameMode::Classic serializes to "Classic" (serde default). The server checks header.mode == "classic" (lowercase). These never match, so the entire leaderboard-update block inside upload() is dead code — no classic-mode replay upload ever updates the leaderboard via this path.

The sync/push leaderboard path (update_leaderboard_if_opted_in in sync.rs) still works, so the leaderboard is not entirely broken. But players who upload replays via the web UI will never see their scores appear.

Fix

Change the comparison to header.mode == "Classic" or use .eq_ignore_ascii_case("classic").

## File `solitaire_server/src/replays.rs` line 119 ## Description `GameMode::Classic` serializes to `"Classic"` (serde default). The server checks `header.mode == "classic"` (lowercase). These never match, so the entire leaderboard-update block inside `upload()` is dead code — no classic-mode replay upload ever updates the leaderboard via this path. The `sync/push` leaderboard path (`update_leaderboard_if_opted_in` in `sync.rs`) still works, so the leaderboard is not entirely broken. But players who upload replays via the web UI will never see their scores appear. ## Fix Change the comparison to `header.mode == "Classic"` or use `.eq_ignore_ascii_case("classic")`.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#14