get_encrypted_app_ticket often returns None
I have librematch-steam_auth running continuously (24/7), and I’ve observed that Steam’s get_encrypted_app_ticket frequently returns None - specifically, this happens every 45 minutes.
Interestingly, this aligns exactly with the interval at which librematch-steam_auth attempts to refresh the app_ticket. This suggests that the script may be entering an invalid or inconsistent state during the refresh cycle, causing get_encrypted_app_ticket to fail.
When None is returned, an exception is thrown, which interrupts the flow unnecessarily. It would be preferable if this case were handled more gracefully, as it appears to be a recurring scenario rather than a rare exception.
Moreover, it would be helpful to investigate the root cause of why get_encrypted_app_ticket fails during these refreshes.
Unhandled None return from get_encrypted_app_ticket
The issue seems to originate from the following line in __init__.py:
if self.steam is not None:
self.app_ticket = AppTicket(
base64.standard_b64encode(
self.steam.get_encrypted_app_ticket(
APPID[0], userdata=b"RLINK"
).encrypted_app_ticket.SerializeToString(deterministic=True)
).decode()
)
The call to get_encrypted_app_ticket(...) can return None, but this is not handled here. As a result, the code attempts to access .encrypted_app_ticket on None, leading to an exception.
Since this failure appears to happen reliably every 45 minutes (likely during a refresh cycle), it would be beneficial to:
-
Guard against None before dereferencing the result.
-
Optionally add a retry mechanism or backoff if this is a temporary issue with Steam’s API.
-
Consider logging the event with more context to help diagnose why the ticket retrieval fails at that specific time.
This change would improve fault tolerance and reduce avoidable interruptions during expected runtime behavior.
get_encrypted_app_ticketoften returnsNoneI have
librematch-steam_authrunning continuously (24/7), and I’ve observed that Steam’sget_encrypted_app_ticketfrequently returnsNone- specifically, this happens every 45 minutes.Interestingly, this aligns exactly with the interval at which
librematch-steam_authattempts to refresh theapp_ticket. This suggests that the script may be entering an invalid or inconsistent state during the refresh cycle, causingget_encrypted_app_ticketto fail.When
Noneis returned, an exception is thrown, which interrupts the flow unnecessarily. It would be preferable if this case were handled more gracefully, as it appears to be a recurring scenario rather than a rare exception.Moreover, it would be helpful to investigate the root cause of why
get_encrypted_app_ticketfails during these refreshes.Unhandled
Nonereturn fromget_encrypted_app_ticketThe issue seems to originate from the following line in
__init__.py:The call to get_encrypted_app_ticket(...) can return None, but this is not handled here. As a result, the code attempts to access .encrypted_app_ticket on None, leading to an exception.
Since this failure appears to happen reliably every 45 minutes (likely during a refresh cycle), it would be beneficial to:
Guard against None before dereferencing the result.
Optionally add a retry mechanism or backoff if this is a temporary issue with Steam’s API.
Consider logging the event with more context to help diagnose why the ticket retrieval fails at that specific time.
This change would improve fault tolerance and reduce avoidable interruptions during expected runtime behavior.