SteamKit icon indicating copy to clipboard operation
SteamKit copied to clipboard

Silent disconnect when a handler throws

Open xPaw opened this issue 5 years ago • 1 comments

https://github.com/SteamRE/SteamKit/blob/58562fcc6f6972181615a6d1ff98103b06f0e33f/SteamKit2/SteamKit2/Steam/SteamClient/SteamClient.cs#L384-L385

I couldn't figure out what was happening last time this happened because it silently logs the exception into the debug log (with no stacktrace) and just disconnects.

This time I had debug log enabled and got this:

18:01:12 [DEBUG] FreeLicense: Received free license: OK (5 apps: 375750, 1077600, 797410, 517630, 517630, 3 packages: 407024, 409937, 410395)
18:01:12 [STEAMKIT] SteamClient: Unhandled 'ArgumentException' exception from 'SteamApps' handler: 'An item with the same key has already been added. Key: 517630'

After that, SK2 started to constantly keep disconnecting with the same message (but without freelicense grant this time). Which eventually got me rate limited by the CM.

xPaw avatar Nov 07 '19 18:11 xPaw

Repro:

Steam.Instance.Apps.PICSGetAccessTokens(new System.Collections.Generic.List<uint>() { 440, 440 }, Enumerable.Empty<uint>());

EDIT: I created #787 to fix the exception in the handler.

However if a handler throws, it shouldn't just eat it into debuglog and silently disconnect. This needs to be improved.

xPaw avatar Nov 07 '19 19:11 xPaw