Fix intermittent GetAuthSessionTicket hang / "Ticket verification failed" on repeated calls (#1567) - #1645
Merged
Conversation
…t calls Steam's acknowledgement for a repeated ClientAuthList is now unreliable: it may omit a matching TargetJobID (so the AsyncJob never completes and the call hangs) or omit the new ticket's CRC from ticket_crc (so the ActiveTicketsCRC check misses and throws "Ticket verification failed"), even though the ticket is valid and is validated server-side via BeginAuthSession. Register a per-CRC TaskCompletionSource before sending, complete it in HandleTicketAcknowledged by matching CMsgClientAuthListAck.ticket_crc, and await it with a timeout; on timeout log and return the ticket instead of throwing. TicketAcceptedCallback is still posted, so existing consumers are unaffected. Fixes SteamRE#1567.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1567.
Problem
GetAuthSessionTicket/GetAuthTicketForWebApiwork on the first call but intermittently break onsubsequent calls in the same session. This regressed after a Steam-side change (reported around Steam's
2025-08 downtime) and shows up two ways:
Ticket verification failed, even though the ticket was submitted and is valid.Both stem from how the auth-list acknowledgement is correlated.
SendTickets()sendsCMsgClientAuthListwith a fresh
SourceJobIDand returns anAsyncJob<TicketAcceptedCallback>keyed on it;HandleTicketAcknowledgedposts the callback keyed onTargetJobID. Steam's ack for a repeated auth list isnow unreliable:
TargetJobID(no re-ack), so theAsyncJobnever completes, which hangs; andticket_crclist may not include the just-added ticket's CRC (it echoes an already-active one instead),so the
ActiveTicketsCRC.Any(...)check inGetAuthSessionTicketInternalmisses and throws.Root-cause diagnosis credit: @K4ryuu in #1567.
Fix
Correlate the acknowledgement by ticket CRC instead of JobID, and stop treating a missing ack as fatal:
TaskCompletionSourcebefore sending the auth list.HandleTicketAcknowledgedby matchingCMsgClientAuthListAck.ticket_crc.DebugLogand return the ticket anyway instead of throwing:the ticket has already been submitted and is validated server-side via
BeginAuthSession, so a missingclient-side ack is no longer a reliable failure signal.
TicketAcceptedCallbackis still posted, so existing consumers are unaffected.SendTickets()no longerneeds to return an
AsyncJob.Testing
Validated against live Steam on .NET 10, same account, patched build vs stock 3.4.0:
Ticket verification failed- the reported throw, reproduced live.intermittent and Steam-state dependent; it is reported by multiple users but did not reproduce on demand
here). The CRC-correlation + timeout path handles it by construction: a non-acked call can no longer block
indefinitely.
Net: ticket retrieval is now robust to Steam's unreliable acks - it neither hangs nor throws spuriously,
whether or not Steam echoes the new ticket's CRC.