Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat can't connect on steam laucnh #5

Closed
Ledragonnantais opened this issue Oct 10, 2023 · 12 comments
Closed

Chat can't connect on steam laucnh #5

Ledragonnantais opened this issue Oct 10, 2023 · 12 comments
Labels
Mitigated A partial resolution is in place, but the root problem is not fully resolved Patch Files Issue regards the patch files
Milestone

Comments

@Ledragonnantais
Copy link

Hey Tiberium, it's Duke Nukem from the steam group of Lightwo. I just wanted to let you know I might have notice an issue:
When I launched my steam for the 1st time today 25 min ago, it didn't connect on the steam chat with your patch. I already had this problem yesterday, and as I did yesterday, I copied again the patch 1.1.0 file, restarted steam, and it worked again.

I'm not sure if I'll have to copy the files every day before launching steam, but it might me a bug. I'll keep this updated for tomorrow to see if the problem is happening again.

@TiberiumFusion
Copy link
Owner

TiberiumFusion commented Oct 10, 2023

You are almost certainly experiencing what I believe is a race condition in Valve's code. If some (unknown) part(s) of the Steam client loads too quickly or too slowly, some other (unknown) part(s) shits the bed and tries to load and run FriendsUI too early. The result is that FriendsUI's internal frame (the one pointed at steam-chat.com normally or the local snapshot with the patch) tries to access some data that does not exist (the injected SteamClient.* interface), and a fatal error is raised.

I have encountered this exact issue myself, but only when testing on a virtual machine where disk access is really, really slow. And even then, the race condition error only had about a 33% chance of happening for any given Steam launch. I've never encountered the problem on my native hardware outside of that vm, though.

lightwo, the fellow who created the y2k24 survival kit Steam guide, maybe also possibly experiences the race condition on his arch linux PC (not a vm). The symptoms occur for him every single time he launches steam, so he is currently unable to use the patch. His hardware employs ssds, but the Steam bootstrapper on Linux is a lot slower than on Windows. I was unable to reproduce the issue in any of my linux vms (0% fail rate), so it is unclear why it fails 100% of the time in his environment. Or it could just be an entirely different issue with his environment altogether. (recent info suggests this)

My current guess is that this problem is a side effect of running the FriendsUI pwa from local files instead of remote ones. The local files are served over a facsimile network interface that is very different from getting a response from a remote server (e.g. steam-chat.com or steamstatic.com). This different pathway must be conducive the race condition, while retrieving these resources from remote is not. Any details beyond that would probably require an extremely tedious investigation into Valve's spaghetti hell that's just not worth doing.

So, my current plan is a symptomatic treatment instead, which should take several orders of magnitude less time to design and implement. Basically, my wrapper code around Valve's FriendsUI pwa would try to detect the race condition fatal error (and/or other fatal errors), and reload the entire FriendsUI. The blue "retry connection" button or whatever it says that Valve created is basically worthless since it does not reload FriendsUI and only reloads the internal iframe to the PWA. So you can click that button again and again and again and it won't help. But if you launch Steam with -cef-enable-debugging and browse to localhost:8080 with a blink-based browser, you can reload the entire FriendsUI, which will fix the problem and friends/chat will successfully connect. This is the type of reload my wrapper code would ideally perform.

This is on the roadmap for the next update to the patch, since it is the only outstanding issue I am aware of.

In the meantime, you can work around the issue by:

  • Launch steam with cef debugging and use a blink browser to reload FriendsUI if it breaks
  • Or, just keep exiting and relaunching Steam until FriendsUI successfully connects

Reinstalling the patch is not necessary. It may, however, influence the outcome of the race condition, depending on how your hardware and OS may or may not accelerate access to recently written files.

@Ledragonnantais
Copy link
Author

Ty for the reply. Notted. For the moment, it happened again when I had to close steam, and instead of re installing files, I waited 30-40s and try to reconnect again, and it worked. So it might be indeed because steam tries to connect too fast. I'll see how it act tomorrow ^^

@TiberiumFusion
Copy link
Owner

@Ledragonnantais
Are you still experiencing the issue? If so, I have a beta version of the patch that you can try.

I'm looking for people who reliably or semi-reliably experience the Valve race condition bug, and thus can test this version of the patch. It contains the potential fix for working around the bug that I outlined in my post above. Unfortunately, my slow vm is no longer reproducing the bug so I cannot test it myself anymore.

If you are interested, here are the patch files:
PatchPayload_v1.1.0.1-{00000000-0000-0000-0000-000000000000}.zip

There's no QuickPatcher this time. You'll have to install the patch manually (see install instructions page on wiki).

And don't worry, you can easily go back to a normal release (like 1.0.0 or 1.1.0) at any time by using the QuickPatcher. It always removes the old patch before installing a new one.

@TiberiumFusion TiberiumFusion added Patch Files Issue regards the patch files In Progress Issue research & resolution is currently underway labels Oct 14, 2023
@Ledragonnantais
Copy link
Author

@Ledragonnantais Are you still experiencing the issue? If so, I have a beta version of the patch that you can try.

I'm looking for people who reliably or semi-reliably experience the Valve race condition bug, and thus can test this version of the patch. It contains the potential fix for working around the bug that I outlined in my post above. Unfortunately, my slow vm is no longer reproducing the bug so I cannot test it myself anymore.

If you are interested, here are the patch files: PatchPayload_v1.1.0.1-{00000000-0000-0000-0000-000000000000}.zip

There's no QuickPatcher this time. You'll have to install the patch manually (see install instructions page on wiki).

And don't worry, you can easily go back to a normal release (like 1.0.0 or 1.1.0) at any time by using the QuickPatcher. It always removes the old patch before installing a new one.

Hello Tiberium. Sorry fore the late reply, as I don't pass here very often. Your beta patch fall at the right moment, as I spent about 10 minutes launching, stopping, restarting steam, because chat couldn't connect, even by force reconnect (while that works but put chat interface in English), while everything worked fine yesterday.

I've installed your patch, and relaunched steam 8 times in a row, and your patch is a success. The chat window popped directly and in my language in less than 10s as it worked normally like months ago. I'll keep you in touch through the next days to see if there's a bug or if everything works and launches finely on the 1st start of steam.
Thanks for the excellent work C:

@TiberiumFusion
Copy link
Owner

TiberiumFusion commented Oct 20, 2023

@Ledragonnantais
Checking in. Have you experienced any problems with the test version since you first installed it? I'm looking for confirmations of no issues from users before I include it in the next update. Unfortunately, this project has an incredibly small user base so there is very little to work with in terms of field testing. You are currently the only user who is known to reliably experience the Valve race condition error and (possibly/hopefully) seen it fixed by the test version of the patch.

@Ledragonnantais
Copy link
Author

Hi Tibe. I make my report ^^ So, on Tuesday, I launched/re launched steam about 15/18 times, had the race bug only 2 times. On Thursday and yesterday, again a good dozen of launch to test, only at the race bug once. And good thing, when it happened, I just waited 20/30s, and retry connection to chat, and the chat popped normally AND in my language which is good.
I didn't notice any other bugs with it, so I think you can deploy it, if you have carefully checked everything ^^

@TiberiumFusion
Copy link
Owner

TiberiumFusion commented Oct 21, 2023

I just waited 20/30s, and retry connection to chat

The blue button that say Retry Connection, right? I included an extra fallback in the test version you've been using that makes the Retry Connection button perform a stronger full reload of the friends list, instead of the weak and ineffective partial reload that Valve made it do. Thanks for inadvertently testing that extra and also confirming it works as intended.

2/15 and 1/12 failure rate is definitely a big improvement over the 100% failure you were getting with the race condition before the test version, but I'd really like to get those numbers down to 0% so it never happens. The workaround in the test version retries the connection 3 times with no delay in between attempts, which is probably(?) good enough for most systems. But I might change that to a small graduated delay between attempts (if possible), which, based on the info you've given, might reduce the failure rate to nearly zero on systems like yours perhaps. Such is the ugly nature of dealing with crap code and race conditions.

At any rate, thanks again for helping test this fix. It will be included in the next update, which will be soon.

@Ledragonnantais
Copy link
Author

No problem. We should be the ones thanking you for having broken your teeth to code that ^^

@TiberiumFusion
Copy link
Owner

TiberiumFusion commented Oct 23, 2023

Patch version 1.2.0 has been released, which addresses this issue using the mitigation noted in the conversation here.

I expect the mitigation in 1.2.0 (improved a bit since the test version it first appeared in) will ensure that the discussed symptom of Valve's race condition (FriendsUI failing to load due to SteamClient.* interface not existing) should be automatically resolved for most affected users. The symptom may still irregularly remain unresolved despite the mitigation, however, as noted by @Ledragonnantais in his report with the test version a few days ago. And it may even still regularly remain unresolved for a handful of users with very esoteric systems. But most affected users should see relief, however small or large that group of unknown size may be.

Since the changes in 1.2.0 are not a deterministic, complete resolution, I am leaving this issue open, at least for the time being. If a significant amount of time goes by with no further reports of the symptom, at that point I will probably close this issue.

@TiberiumFusion TiberiumFusion added Mitigated A partial resolution is in place, but the root problem is not fully resolved and removed In Progress Issue research & resolution is currently underway labels Oct 23, 2023
@TiberiumFusion TiberiumFusion added this to the Release 1.2.0 milestone Oct 23, 2023
@Ledragonnantais
Copy link
Author

o7 I'll test the patch tomorrow and come if any probs.

@Ledragonnantais
Copy link
Author

So, I tested patch 1.2. Started steam 10 times in a row. Had race bug on very 1st, and 3rd launch, didn't happen again after, and as usual, you wait 20s, try reconnect and it shows the chat normally.
I don't think there will be any bugs. As usual, I'll see through the week, and will report any problems if there is.

@TiberiumFusion
Copy link
Owner

Since this issue was mitigated in release 1.2.0, two months have now elapsed and I have received zero additional reports of the issue. As I noted previously, I am closing this issue accordingly. Ofc if the issue resurfaces it will be re-opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mitigated A partial resolution is in place, but the root problem is not fully resolved Patch Files Issue regards the patch files
Projects
None yet
Development

No branches or pull requests

2 participants