Skip to content

fix: accept string Steam IDs in SDA imports - #521

Merged
dyc3 merged 1 commit into
masterfrom
pullfrog/520-accept-string-steam-id
Sep 22, 2026
Merged

dyc3 merged 1 commit into
masterfrom
pullfrog/520-accept-string-steam-id

Conversation

@pullfrog

@pullfrog pullfrog Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept Session.SteamID as either a JSON number or a quoted decimal string in SDA maFiles
  • preserve the existing behavior for missing and null Steam IDs
  • add a migration fixture matching the modern session shape posted in ERROR Failed to import account #520

Root cause

Import first attempts the current SteamGuardAccount schema. SDA maFiles do not have its required top-level steam_id, so falling back to external account import is expected.

The SDA fallback then deserializes Session.SteamID as Option<u64>. Option supports an absent field or null, but Serde does not coerce the posted string value ("76561000000000000") into a u64, so the SDA variant fails. The alternative Steam Mobile v2 variant also fails because it requires a top-level steamid. Since ExternalAccount is untagged, Serde reports only the generic data did not match any variant error after both variants fail. The Winauth message is from the subsequent fallback and is not the cause.

The field now uses a compatibility deserializer accepting both supported SDA representations while still rejecting invalid or out-of-range values.

Verification

  • reproduced the failure through steamguard import with a sanitized copy of the posted JSON
  • verified the same import succeeds after the fix and preserves the Steam ID
  • cargo test -p steamguard-cli --features qr
  • cargo fmt --all -- --check
  • git diff --check

Closes #520

Pullfrog  | View workflow run | via Pullfrog | Using GPT Sol (free via Pullfrog for OSS) | 𝕏

@pullfrog
pullfrog Bot requested a review from dyc3 September 22, 2026 22:56
@dyc3
dyc3 merged commit b6c439c into master Sep 22, 2026
3 checks passed
@dyc3
dyc3 deleted the pullfrog/520-accept-string-steam-id branch September 22, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR Failed to import account

1 participant