feat(crash): the game's crash window drawn by the launcher, with Report automatically and manually #46
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!46
Loading…
Reference in a new issue
No description provided.
Delete branch "gab9281/LongshotLauncher:feat/crash-window"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: medium · Tested on: Linux, RTX 3060 Laptop · Needs: Windows, any GPU
Why
After a crash, Longshot's crash window (MagicBeanDev/Longshot#593, on main) is a plain English message box. With MagicBeanDev/Longshot#141 it offers two ways to report: Report automatically (the report shown in full, sent to Longshot's #81 only when pressed) and Report manually (the report on the clipboard and the prefilled issue form). The game folder has no Python to make the automatic report, and its box can't look like the launcher or speak the player's language. So, in a build the launcher made, the launcher draws the window: the same on Windows and Linux, in the launcher's look and the player's language.
What changed
The game's crash helper decides what the window says and starts the launcher of the build's
sender=with--crash-window; the launcher draws it, and makes and sends the report with the build's ownnx2/crash_report.py. When it can't show the window it exits 3 and the game shows its boxes, which use--crash-previewand--crash-send.--crash-window <folder> <window.txt>(Core/CommandLine.cs,App/Program.cs,App/App.axaml.cs): the window alone, with no instance lock (beside an open launcher), no update check and no main window. 0 once shown and closed, 3 when it can't be shown (awindow.txtit can't read, no display).Core/CrashWindowInfo.cs:CrashWindowInfo:window.txtread (verdict,stage,cause,record,send,report,issue,logs); a word it doesn't know, a record that is a path or an issue link that isn't https is refused. The title, the headline and the cause as whole translatable sentences, the game's own words.CrashCard: the preview's card (crash_report.py --card) and its rows.CrashSendAnswer: the send's answer; only an https link is kept.App/CrashWindow.cs, in the old crash window's look (its two pictures back inApp/Assets/):bug-reports/pending/sending-<record>*) removed once it's closed; a send still going finishes by itself.--crash-previewand--crash-send(Core/CrashReports.cs): crash_report.py with the folder's own version's Python, or the newest installed tools that have it, in the game's environment, with no window; for the game's boxes.CardCommandandRunAsyncfor the window.Core/MakeGameCommand.cs:LONGSHOT_CRASH_SENDERis the launcher's start path, which make_game.py writes assender=.Testing
Tested (CachyOS, KDE Wayland, RTX 3060 Laptop, .NET 10), at
bdea43don mainaacfe1c:57237ec(head98e7bac): the build (0 warnings),tests/test_launcher_core.py --strict(1328 checks),tests/test_release.pyandscripts/translations.pypass again.dotnet build App -c Release: 0 warnings, 0 errors.python -I scripts/translations.py: 606 texts, 15 catalogs, all complete.python -I tests/test_launcher_core.py: 1080 checks passed.tests/launcher_core/CrashChecks.cs: the three commands and their values,window.txtread and refused, the card and its rows (in English and French), the send's answer, which tools make the report, the commands' arguments and environment.python -I tests/test_release.py: OK.HOS_CRASH_TEST=8, a folder whosesender=is this launcher): the window opened with the card; Report manually put the report on the clipboard and opened the form; Report automatically sent it to the deployed telemetry: the comment on #81, with the card's values; Close ended it with no box from the game after.Not tested: Windows (this PC is Linux only); a Flatpak launcher.
Must be tested:
HOS_CRASH_TEST=8inlongshot_env.txt, start the game, and expect after the crash this window (not the game's box), the card filled, Report manually putting the report on the clipboard, and Close ending it with no box after. Don't press Report automatically unless you mean to post on #81 (test request T-B5BV).Risks
What could break: the crash window after a crash, if the launcher starts but can't show anything: the game then shows no box. A launcher without
--crash-window(before this PR) never gets started by the game: only builds this launcher makes name it.Turning it off: the game's
HOS_CRASH_WATCH=0; or revert.Compatibility: builds made by this launcher gain
sender=inlongshot_version.txt. Nothing else changes.Checklist
main.tests/test_launcher_core.py,tests/test_release.py,scripts/translations.py).86f79d2).Co-Authored-By:trailers.🤖 Generated with Claude Code
https://claude.ai/code/session_015KgSKmeEEMir1hCDFZ8BmR
crash_report.py --window answers {"crash": false, "error": ...} when the report can't be made (Longshot #141's review); the window shows that reason. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgiWIP: feat(crash): the crash window, --crash <folder>to feat(crash): the crash window, --crash <folder>86f79d241c35c7603c50feat(crash): the crash window, --crash <folder>to WIP: feat(crash): send a crash report from the game's crash window (--crash-preview, --crash-send)Reworked for the design where the game's own crash window (Longshot#593) sends: the launcher's window is gone, and the launcher is now a headless sender (
--crash-preview,--crash-send) that runs the build'snx2/crash_report.py. Force-pushed as35c7603on main3eeaf02. Checks: 1035 passed; an end-to-end run of the real binary against a stand-in relay is in the description. Back to WIP until the game's window has been clicked through in a real build.Still WIP: this PR grows a
--crash-window <folder> <record> ...mode that draws the crash window itself (the look of the earlier CrashWindow, in the launcher's language), started by the game's crash helper (Longshot#141);--crash-previewand--crash-sendstay for the fallback. The headless commands were tested end to end in the game (Linux): preview, Send, Sent.cd8cd23275648a892b08648a892b08bdea43d979WIP: feat(crash): send a crash report from the game's crash window (--crash-preview, --crash-send)to WIP: feat(crash): the game's crash window drawn by the launcher, with Report automatically and manuallyRebased on main (
aacfe1c) and grown,bdea43d: the launcher now draws the game's crash window itself (--crash-window), in its look and the player's language, with Report automatically and Report manually (Longshot#141). Tested in the game on Linux with a real send (the comment on #81); 1080 core checks pass. The description is rewritten. Left: a Windows run.WIP: feat(crash): the game's crash window drawn by the launcher, with Report automatically and manuallyto feat(crash): the game's crash window drawn by the launcher, with Report automatically and manuallyOut of WIP, with Longshot#141 (ready for review): still on main
aacfe1c, the checks pass, and the flow was tested end to end in the game on Linux (the card, Report manually, a real Report automatically to #81, Close with no box after). The Windows run stays in Must be tested, as test request T-B5BV.bdea43d9796a246131466a2461314698e7bac01fCode review of the diff (
98e7bac), read against Longshot's PR MagicBeanDev/Longshot#141 (bc2b2512). I ran no tests.The two PRs agree:
--crash-window <folder> <window.txt>,--crash-preview/--crash-send(four values), thewindow.txtkeys and words (verdict/stage/cause/record/send/report/issue/logs), thesending-<record>{.json,.txt,.card.json,.answer.txt}names underbug-reports/pending, exit 3 = not shown, thesender=/LONGSHOT_CRASH_SENDERpath, thecrash_report.pyarguments (--record,--preview ... --card,--send-file ... --answer) and the card's JSON keys all match what the game side writes and reads.Privacy and consent look right. Nothing is sent until Report automatically is pressed; the card, "Show" and "Show all of it" display the exact payload file that
--send-fileposts; the window says the report is posted publicly (and on which issue). Onlyhttpslinks are opened (issue form, "See it"); the record name is checked as a name, never a path; the report content and redaction stay in Longshot'scrash_report.py. The two pictures were already in this repository.No blocker found in the code. Left as COMMENT, not approval, because the PR's own Must be tested is a Windows run (T-B5BV), which is a gate for merge: the window is the only thing a player sees after a crash, and nothing here has run on Windows yet. I read no tester results in the comments yet.
Smaller points are inline. None needs to block the merge once Windows has passed.
@ -0,0 +187,4 @@}catch (Exception e) when (e is InvalidOperationException or IOException or PlatformNotSupportedException) { }}var opened = info.Issue.Length > 0 && Open(info.Issue);Nit:
info.Reportis a path fromwindow.txtthat is read and put on the clipboard, andOpen(saved)opens it with the shell (UseShellExecute), so whatever program handles that file type runs on it. It comes from the game's helper (report-<UTC>.txt), so it is trusted, but a check that it ends in.txtand sits under<folder>/bug-reports/pendingwould match the care taken withrecordandissueinCrashWindowInfo.Parse.@ -0,0 +326,4 @@send.IsEnabled = true;}window.Closed += (_, _) =>If the window is closed while a send is going (
sendingtrue), these four files are not removed, and theif (closed) return;after the send never cleans up either (the process ends with the window, sinceShutdownModeisOnLastWindowClose). Sobug-reports/pending/sending-<record>.json(the report as it would be posted),.answer.txtand the others stay on disk for good. It is not a leak (the report is already redacted, and the player pressed Send), but it is clutter that nothing sweeps. Suggest either removing any oldersending-*files whenLoad()starts, or saying in the comment that they are left on purpose.@ -92,0 +103,4 @@{if (Start.Problem != null || Start.CrashArgs is not [_, var file] || CrashWindowInfo.Read(file) is not { } info) return 3;Crash = info;try { BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); }The game's helper waits for this process with no time limit (
spawn_exe(..., 3, -1, ...)in Longshot'swindow_in_launcher). If Avalonia starts but never opens the window (a hung compositor or GPU init on a machine that just crashed on its graphics driver, which is the likely case here),CrashShownstays false, nothing returns, and the player sees neither the launcher's window nor the game's boxes. An exception is handled (exit 3), a hang is not. Worth a watchdog: ifCrashShownisn't set within ~20 s, exit 3 so the game falls back to its boxes. Ask for this at least to be considered with the Windows run.@ -0,0 +75,4 @@if (!IsRecordName(record)) why = "That is not a crash record's name.";else if ((mine = ToolsFor(folder, tools)) == null)why = "None of this launcher's tools can make the report (they are from before Report automatically): update the build.";if (mine == null || why != null) return Said(output, send, why ?? "");Nit:
output(andpayload) are written/read as given on the command line, with only the record name checked. The game is the only caller, so it is fine, butSaidwill overwrite any path it is given. Checking that both files are inside<folder>/bug-reports/pendingwould make--crash-previewand--crash-sendsafe to leave as a command a person could mistype, at the cost of one line and a test.Closing: this one is superseded. The crash window is now the game's own (MagicBeanDev/Longshot#983). It is drawn like the Insert menu, and the game builds and sends its report itself, so any build can report a crash, not only one the launcher made. The launcher's
--crash-*commands are therefore gone. What remains on the launcher's side is in #128: the Send crash reports automatically tick, which lets the game send its report without showing the window.🤖 Generated with Claude Code
Pull request closed