bug(server): sync push always rejected — user_id nil placeholder fails mismatch check #73
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
POST /api/sync/pushreturns400 Bad Request: user_id mismatchfor every authenticated push from the desktop client.Root cause
build_payload()insolitaire_engine/src/sync_plugin.rsalways setsuser_id: Uuid::nil()with the comment "the server replaces it with the authenticated user's real ID when it processes the push request".However the server handler (
solitaire_server/src/sync.rsline 148) does not replace it — it rejects it:Because
Uuid::nil()("00000000-0000-0000-0000-000000000000") never equals the authenticated user's real UUID, all pushes fail and no data is ever synced to the server.Impact
push_on_exitalways returns an error that is only logged, not visible to the player.Fix
Before the mismatch check, replace a nil
user_idplaceholder with the authenticated user's real UUID (fulfilling the original design intent).Fix (commit
7eb1181)The server's
pushhandler now acceptsUuid::nil()as a valid placeholder and replaces it with the authenticated user's real UUID before the mismatch check:The desktop client's
build_payload()always sendsUuid::nil()as a placeholder (as documented in its docstring). The server now fulfils the original design intent by stamping the authenticated user's real UUID onto the payload before merging and persisting. Payloads that explicitly claim a different user's non-nil UUID are still rejected.