fix(data): enforce 32-char display_name limit at sync client boundary (M-22)
opt_in_leaderboard in sync_client.rs was passing display_name through as-is, relying solely on the engine's .chars().take(32) call upstream. Add the truncation in the sync client so any caller is protected, and also apply it at save-time in handle_display_name_confirm so settings never stores an over-length name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -746,7 +746,7 @@ fn handle_display_name_confirm(
|
||||
return;
|
||||
}
|
||||
if let Some(mut settings) = settings {
|
||||
let trimmed = buf.0.trim().to_string();
|
||||
let trimmed: String = buf.0.trim().chars().take(32).collect();
|
||||
settings.0.leaderboard_display_name = if trimmed.is_empty() {
|
||||
None
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user