[server] ReplayHeader.seed is i64 but client Replay.seed is u64 — high-bit seeds rejected #32

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

Files

  • solitaire_server/src/replays.rs line 39
  • solitaire_data/src/replay.rs line 125

Description

The client's Replay.seed is u64. The server deserializes the same JSON field into ReplayHeader.seed: i64. For any seed value exceeding i64::MAX (9,223,372,036,854,775,807), serde_json returns a deserialization error and the upload fails with HTTP 400. Seeds derived from u64 RNG with high-bit entropy (e.g. hash-based or system-time-derived seeds) can exceed this limit. When they do, the replay upload silently fails with no error surfaced in the client UI.

Fix

Change ReplayHeader.seed to u64, or add a #[serde(deserialize_with = "...")] helper that accepts both signed and unsigned integer representations.

## Files - `solitaire_server/src/replays.rs` line 39 - `solitaire_data/src/replay.rs` line 125 ## Description The client's `Replay.seed` is `u64`. The server deserializes the same JSON field into `ReplayHeader.seed: i64`. For any seed value exceeding `i64::MAX` (9,223,372,036,854,775,807), serde_json returns a deserialization error and the upload fails with HTTP 400. Seeds derived from `u64` RNG with high-bit entropy (e.g. hash-based or system-time-derived seeds) can exceed this limit. When they do, the replay upload silently fails with no error surfaced in the client UI. ## Fix Change `ReplayHeader.seed` to `u64`, or add a `#[serde(deserialize_with = "...")]` helper that accepts both signed and unsigned integer representations.
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#32