feat(crash): the game's crash window drawn by the launcher, with Report automatically and manually #46

Closed
gab9281 wants to merge 2 commits from gab9281/LongshotLauncher:feat/crash-window into main
Member

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 own nx2/crash_report.py. When it can't show the window it exits 3 and the game shows its boxes, which use --crash-preview and --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 (a window.txt it can't read, no display).
  • Core/CrashWindowInfo.cs:
    • CrashWindowInfo: window.txt read (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 in App/Assets/):
    • the headline, "What went wrong", and what each button does;
    • the card, "What Report automatically sends", with Show for the settings and the log and Show all of it for the report itself;
    • Open the log folder, Report manually (the clipboard, the issue form, then Open the report), Close, and Report automatically, then Sent with See it on #81, or Not sent and why with Try again;
    • the report's files (bug-reports/pending/sending-<record>*) removed once it's closed; a send still going finishes by itself.
  • --crash-preview and --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. CardCommand and RunAsync for the window.
  • Core/MakeGameCommand.cs: LONGSHOT_CRASH_SENDER is the launcher's start path, which make_game.py writes as sender=.
  • Translations: the window's 69 texts in all 12 full catalogs; fr-CA and es-419 where they differ.
  • README: the three commands in the command-line table.

The launcher's crash window after a crash on purpose, Report manually pressed

After Report automatically: sent

Testing

Tested (CachyOS, KDE Wayland, RTX 3060 Laptop, .NET 10), at bdea43d on main aacfe1c:

  • Rebased on main 57237ec (head 98e7bac): the build (0 warnings), tests/test_launcher_core.py --strict (1328 checks), tests/test_release.py and scripts/translations.py pass 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.txt read 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.
  • In the game, with Longshot#141 (HOS_CRASH_TEST=8, a folder whose sender= 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:

  • Windows, any GPU: build with this launcher, set HOS_CRASH_TEST=8 in longshot_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= in longshot_version.txt. Nothing else changes.

Checklist

  • One topic.
  • The title is a Conventional Commit.
  • Rebased on current main.
  • The launcher's checks pass (tests/test_launcher_core.py, tests/test_release.py, scripts/translations.py).
  • No game files or anything made from them.
  • The license is OK: GPL-3.0-or-later; the two pictures are the ones this repository had (86f79d2).
  • AI assistance recorded with Co-Authored-By: trailers.
  • Screenshots for a change that shows on screen.
  • Docs updated (the README's command table).
  • Tested in the game (Linux), end to end with Longshot#141; Windows is in Must be tested, with test request T-B5BV.

🤖 Generated with Claude Code

https://claude.ai/code/session_015KgSKmeEEMir1hCDFZ8BmR

**Type:** feat · **Risk:** medium · **Tested on:** Linux, RTX 3060 Laptop · **Needs:** Windows, any GPU ## Why After a crash, Longshot's crash window (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/593, on main) is a plain English message box. With https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/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 own `nx2/crash_report.py`. When it can't show the window it exits 3 and the game shows its boxes, which use `--crash-preview` and `--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 (a `window.txt` it can't read, no display). - **`Core/CrashWindowInfo.cs`**: - `CrashWindowInfo`: `window.txt` read (`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 in `App/Assets/`): - the headline, "What went wrong", and what each button does; - the card, "What Report automatically sends", with **Show** for the settings and the log and **Show all of it** for the report itself; - **Open the log folder**, **Report manually** (the clipboard, the issue form, then **Open the report**), **Close**, and **Report automatically**, then **Sent** with **See it on #81**, or **Not sent** and why with **Try again**; - the report's files (`bug-reports/pending/sending-<record>*`) removed once it's closed; a send still going finishes by itself. - **`--crash-preview` and `--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. `CardCommand` and `RunAsync` for the window. - **`Core/MakeGameCommand.cs`**: `LONGSHOT_CRASH_SENDER` is the launcher's start path, which make_game.py writes as `sender=`. - **Translations**: the window's 69 texts in all 12 full catalogs; fr-CA and es-419 where they differ. - **README**: the three commands in the command-line table. ![The launcher's crash window after a crash on purpose, Report manually pressed](https://git.magicbean.dev/attachments/402d58e8-17fe-434e-8c6d-10184c02d46e) ![After Report automatically: sent](https://git.magicbean.dev/attachments/3c60a140-c78a-4247-86ef-839e8efa3a2e) ## Testing **Tested** (CachyOS, KDE Wayland, RTX 3060 Laptop, .NET 10), at bdea43d on main aacfe1c: - Rebased on main 57237ec (head 98e7bac): the build (0 warnings), `tests/test_launcher_core.py --strict` (1328 checks), `tests/test_release.py` and `scripts/translations.py` pass 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.txt` read 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. - In the game, with Longshot#141 (`HOS_CRASH_TEST=8`, a folder whose `sender=` 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](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/81#issuecomment-22651), 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:** - Windows, any GPU: build with this launcher, set `HOS_CRASH_TEST=8` in `longshot_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=` in `longshot_version.txt`. Nothing else changes. ## Checklist - [x] One topic. - [x] The title is a Conventional Commit. - [x] Rebased on current `main`. - [x] The launcher's checks pass (`tests/test_launcher_core.py`, `tests/test_release.py`, `scripts/translations.py`). - [x] No game files or anything made from them. - [x] The license is OK: GPL-3.0-or-later; the two pictures are the ones this repository had (86f79d2). - [x] AI assistance recorded with `Co-Authored-By:` trailers. - [x] Screenshots for a change that shows on screen. - [x] Docs updated (the README's command table). - [x] Tested in the game (Linux), end to end with Longshot#141; Windows is in Must be tested, with test request T-B5BV. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015KgSKmeEEMir1hCDFZ8BmR
feat(crash): the crash window, --crash <folder>
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 18s
a0873ef17c
After a crash the game starts its folder's builder= (this launcher) with
--crash <folder> (Longshot's host/hos_crash_window.c). The window shows
everything the report holds, and sends it only on Send Help, to
Longshot's crash issue; I am sorry sends nothing.

- Core/CrashReports.cs: the report is Longshot's nx2/crash_report.py,
  run with the folder's version's Python (or the newest installed tools
  that have it): --window for what to show, nothing sent; --send --json
  after Send Help. The send is a process of its own, so the window can
  close during a slow send and the send finishes; the report is kept
  unless it went or was refused. I am sorry drops only that crash's
  marker; the Always send tick is longshot_crash.ini in the folder.
- App/CrashWindow.cs: the window, in code as SetupWindows, with the two
  beans (Magic Bean's own art, from Longshot #141).
- --crash runs without the instance lock (beside an open launcher); a
  crash whose window never opened is offered at the launcher's start.
- tests: CrashChecks (22 checks).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgi
fix(crash): the review's findings on the crash window
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 2s
ff11da587e
- One window per crash: CrashReports.Hold (crash_window.lock, held
  alone); a second --crash, or the launcher's start, leaves a crash that
  has a window. No more two sends of one report.
- The start offers a crash only when its tools read it and --window
  answers with a report (no window for an empty marker), and goes on to
  the next build otherwise.
- Closing before an answer is I am sorry even while --window still reads
  (the marker's time read at open); tools that can't read the report
  keep it until the build is updated.
- ReadWindow/ReadSend read values of any JSON kind as text, never throw.
- The tick is put back, with the reason, when it can't be saved, and
  starts from the script's answer.
- --crash builds only the toolchains, not a LauncherService.
- The tools run in GamePlay.Environment (no LD_LIBRARY_PATH or AppImage
  runtime), not a second list.
- --crash /a --launch /b keeps /a.
- No Ui.Post after awaits that are on the UI thread already.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgi
fix(crash): the window says why the report couldn't be made
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
86f79d241c
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_015KgSKoUqUvce5UXG89NBgi
gab9281 changed title from WIP: feat(crash): the crash window, --crash <folder> to feat(crash): the crash window, --crash <folder> 2026-11-13 17:57:04 +00:00
gab9281 force-pushed feat/crash-window from 86f79d241c
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
to 35c7603c50
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
2026-11-15 00:12:43 +00:00
Compare
gab9281 changed title from feat(crash): the crash window, --crash <folder> to WIP: feat(crash): send a crash report from the game's crash window (--crash-preview, --crash-send) 2026-11-15 00:16:40 +00:00
Author
Member

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's nx2/crash_report.py. Force-pushed as 35c7603 on main 3eeaf02. 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.

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's `nx2/crash_report.py`. Force-pushed as 35c7603 on main 3eeaf02. 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.
Author
Member

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-preview and --crash-send stay for the fallback. The headless commands were tested end to end in the game (Linux): preview, Send, Sent.

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-preview` and `--crash-send` stay for the fallback. The headless commands were tested end to end in the game (Linux): preview, Send, Sent.
feat(crash): the game's crash window drawn by the launcher (--crash-window)
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 15s
cd8cd23275
The game's helper starts `<launcher> --crash-window <folder> <window.txt>` and the launcher draws the
window, the same on Windows and Linux, in the launcher's look and the player's language: what went
wrong, Report automatically (the card of everything it would send, sent only when pressed) and
Report manually (the report on the clipboard and the prefilled issue form). It exits 0 once shown,
3 when it can't be, and then the game shows its own boxes.

- Core/CrashWindowInfo.cs: window.txt, the card (crash_report.py --card) and the send's answer read
- App/CrashWindow.cs: the window, in the old crash window's look, with its two pictures back
- the translations for all 15 catalogs
- checks in tests/launcher_core/CrashChecks.cs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015KgSKmeEEMir1hCDFZ8BmR
gab9281 force-pushed feat/crash-window from cd8cd23275
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 15s
to 648a892b08
Some checks failed
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
2026-11-15 04:36:48 +00:00
Compare
gab9281 force-pushed feat/crash-window from 648a892b08
Some checks failed
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
to bdea43d979
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
2026-11-15 04:38:54 +00:00
Compare
gab9281 changed title from WIP: 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 manually 2026-11-15 04:39:24 +00:00
Author
Member

Rebased 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.

Rebased 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](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/81#issuecomment-22651)); 1080 core checks pass. The description is rewritten. Left: a Windows run.
gab9281 changed title from WIP: feat(crash): the game's crash window drawn by the launcher, with Report automatically and manually to feat(crash): the game's crash window drawn by the launcher, with Report automatically and manually 2026-11-15 05:46:35 +00:00
Author
Member

Out 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.

Out 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.
gab9281 force-pushed feat/crash-window from bdea43d979
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
to 6a24613146
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
2026-11-15 18:26:51 +00:00
Compare
gab9281 force-pushed feat/crash-window from 6a24613146
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
to 98e7bac01f
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
2026-11-15 19:32:20 +00:00
Compare
HumanBean left a comment

Code 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), the window.txt keys and words (verdict/stage/cause/record/send/report/issue/logs), the sending-<record>{.json,.txt,.card.json,.answer.txt} names under bug-reports/pending, exit 3 = not shown, the sender= / LONGSHOT_CRASH_SENDER path, the crash_report.py arguments (--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-file posts; the window says the report is posted publicly (and on which issue). Only https links 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's crash_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.

Code review of the diff (98e7bac), read against Longshot's PR https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/141 (bc2b2512). I ran no tests. **The two PRs agree**: `--crash-window <folder> <window.txt>`, `--crash-preview`/`--crash-send` (four values), the `window.txt` keys and words (`verdict`/`stage`/`cause`/`record`/`send`/`report`/`issue`/`logs`), the `sending-<record>{.json,.txt,.card.json,.answer.txt}` names under `bug-reports/pending`, exit 3 = not shown, the `sender=` / `LONGSHOT_CRASH_SENDER` path, the `crash_report.py` arguments (`--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-file` posts; the window says the report is posted publicly (and on which issue). Only `https` links 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's `crash_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);
Owner

Nit: info.Report is a path from window.txt that is read and put on the clipboard, and Open(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 .txt and sits under <folder>/bug-reports/pending would match the care taken with record and issue in CrashWindowInfo.Parse.

Nit: `info.Report` is a path from `window.txt` that is read and put on the clipboard, and `Open(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 `.txt` and sits under `<folder>/bug-reports/pending` would match the care taken with `record` and `issue` in `CrashWindowInfo.Parse`.
@ -0,0 +326,4 @@
send.IsEnabled = true;
}
window.Closed += (_, _) =>
Owner

If the window is closed while a send is going (sending true), these four files are not removed, and the if (closed) return; after the send never cleans up either (the process ends with the window, since ShutdownMode is OnLastWindowClose). So bug-reports/pending/sending-<record>.json (the report as it would be posted), .answer.txt and 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 older sending-* files when Load() starts, or saying in the comment that they are left on purpose.

If the window is closed while a send is going (`sending` true), these four files are not removed, and the `if (closed) return;` after the send never cleans up either (the process ends with the window, since `ShutdownMode` is `OnLastWindowClose`). So `bug-reports/pending/sending-<record>.json` (the report as it would be posted), `.answer.txt` and 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 older `sending-*` files when `Load()` 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); }
Owner

The game's helper waits for this process with no time limit (spawn_exe(..., 3, -1, ...) in Longshot's window_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), CrashShown stays 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: if CrashShown isn'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.

The game's helper waits for this process with no time limit (`spawn_exe(..., 3, -1, ...)` in Longshot's `window_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), `CrashShown` stays 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: if `CrashShown` isn'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 ?? "");
Owner

Nit: output (and payload) 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, but Said will overwrite any path it is given. Checking that both files are inside <folder>/bug-reports/pending would make --crash-preview and --crash-send safe to leave as a command a person could mistype, at the cost of one line and a test.

Nit: `output` (and `payload`) 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, but `Said` will overwrite any path it is given. Checking that both files are inside `<folder>/bug-reports/pending` would make `--crash-preview` and `--crash-send` safe to leave as a command a person could mistype, at the cost of one line and a test.
Author
Member

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

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](https://claude.com/claude-code)
gab9281 closed this pull request 2026-11-16 18:39:50 +00:00
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!46
No description provided.