Repository navigation
Run Map: never launch without the sign-in lock, and keep the Battle.net window out of sight - #1627
Merged
Merged
Conversation
Run Map gave up on the renewal lock after 30 s and, in wc3LaunchMode "auto", treated that like any renewal failure: it launched on the stored sign-in without the lock. Another Run Map, grill run or harness run holds the lock through its renewal (up to 90 s) and until its client signs in (up to 120 s), so that unlocked launch could spend the token the other client had not read yet, leaving one of them at the login panel. The lock wait now covers a renewal and a sign-in (240 s), says why the run is waiting, and ends in a LockBusyException. RunMap.renewOrRefuse turns that into a failed run in every mode; other renewal failures keep their fallback. This mirrors grill run (wurstscript/WurstSetup#90).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Asked to start Warcraft III for the renewal, Battle.net creates a window and shows it in front, and shows it again as the launched client signs in, ten to twenty seconds later. The handoff after the launch (BattleNetLaunchWindows) minimized it only once it had flashed on screen. Before asking, the renewal now starts battlenet-window.ps1, a copy of the wc3-e2e-harness script, run with -File from a content-named temp copy. It hooks window creation: each new Battle.net window is moved off-screen as it is created, shown out of sight, and minimized without activation with its restore position set back, so the user's own next Restore opens it normally. It also hides a window the app shows again or restores, closes a crash reporter of the renewal's closed client, and ends a minute after the map's client appears.
Updates the copy of wc3-e2e-harness battlenet-window.ps1. Until the run's client appeared, the watcher closed every new BlizzardError.exe, so a crash report from a game the user already had open was cut short too. It now closes a new reporter only when its parent is a renewal client it saw (started by Battle.net) or a process already gone that was not one of the games running before; every other reporter is left alone.
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.
Two fixes to Run Map's Battle.net sign-in renewal (#1624).
1. Never launch without the sign-in lock
BattleNetSignIn.acquireGate()waited only 30 s for the shared Battle.net sign-in lock, then threw a plainIOException.RunMap.renewBattleNetSignIntreats anyIOExceptionfromrenew()as "could not renew", so inwc3LaunchMode"auto" it launched on the stored sign-in without the lock.Another Run Map,
grill runor other tool's run legitimately holds that lock through its renewal (up to 90 s) and until its client signs in (up to 120 s). An unlocked launch in that window can spend the token that client has not read yet, leaving one of them at the login panel.GATE_WAIT_SECONDS= 90 + 120 + 30 s.BattleNetSignIn.LockBusyException.RunMap.renewOrRefuseturns it into a failed run in every mode ("Run the map again once it has signed in.").This mirrors the fix in
grill run(wurstscript/WurstSetup#90).2. Keep the Battle.net window out of sight
Asked to start Warcraft III for the renewal, Battle.net creates a window and shows it in front. Depending on its "when I launch a game" setting, it leaves it there. It also shows it again as the launched client signs in, 10–20 s later. The handoff after the launch (
BattleNetLaunchWindows, #1625) can only minimize it after it has flashed on screen.Before asking, the renewal now starts
battlenet-window.ps1, a shared window-watcher script:SetWinEventHook). Each new Battle.net window is moved off-screen as it is created, shown out of sight, and minimized without activation.BlizzardError.exe) that appears before the map's client, which can only belong to the renewal's closed client.WINDOW_WATCH_SECONDSwithout one.-Filefrom a content-named temp copy: passed with-EncodedCommand, the script is close to Windows' 32,767-character command line limit.-FocusGame, sinceBattleNetLaunchWindowsfocuses the client by process id.Validation
Tests pass:
BattleNetSignInTest(9)BattleNetLaunchWindowsTest(1)InitialBuildProgressTest(8)MapRequestPatchTargetTests(17)WurstBuildConfigTests(14)BuildDiagnosticsTests(10)MapModelReuseTests(56)New tests cover:
LockBusyExceptionafter a short, injectable wait, with the wait reported;renewOrRefuserefusing on a busy lock and passing other failures on;Live on Windows, twice, through
BattleNetSignIn.renew(), a direct launch andreleaseWhenSignedIn(), with a separate logger sampling every 100 ms:The same sequence without the watcher showed Battle.net's window in front during the renewal and again ~19 s after launch.
Not tried from VS Code's Run Map itself.