feat: Copy for a bug report on the launcher's failures, with the launcher's log of what it asked the network #93
No reviewers
Labels
No labels
area/build
area/install
area/saves
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!93
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:feat/bug-report"
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?
Several players can't reach git.magicbean.dev from the launcher (Longshot#738 and others), and all they can send us is the one sentence on the screen. To find out which request failed, how, and through which proxy, the launcher needs a log and a way to hand it over.
Copy for a bug report now sits beside each of the launcher's failures. It copies what happened, the launcher's version and how it's installed, the system, the network setup (git-cdn first or not, the proxy), and the launcher's log of this run.
What the report looks like
A real one: the update check, run through this branch's code with
HTTPS_PROXYpointing at a proxy that doesn't answer:It shows what the screen can't: git-cdn was tried first, then git.magicbean.dev, each twice, all through the proxy, which refused.
What changed
Core/LauncherLog.cs: the launcher's log for this run, in memory only (the last 500 lines). Nothing is written to disk.HttpFetcherandCdnFetcherlog each request: the link, then the HTTP status (and where it redirected) or why there was no answer (HttpRequestErrorand .NET's own words), how long it took, and the proxy. Downloads also log their size at the end, or where and why they stopped. The CDN's fall back to git.magicbean.dev is logged too.Core/BugReport.cs: one report format for every screen. The home folder shows as~(in any case on Windows, and never a longer folder that only starts like it), so no user name goes with it.No game file, key or save goes into a report: only what the screens say, links, and paths with the home folder as
~. The report only goes to the clipboard, and the player decides where to paste it.Screenshots
Drawn with
tools/screenshots, which has a scene for each of these now. They are in the comment below.tools/screenshotsdidn't compile on main (LauncherService.Gpusbecame read-only whenGpuCardscame in, and CI doesn't build the tool). Its three scenes that set a GPU now setGpuCards. Step 1 also gets asearch: falseswitch, so a screenshot never lists game files from the PC it's drawn on. The failed save copy has no scene: it needs a whole saves setup.Testing
python -I tests/test_launcher_core.py: 1175 checks pass. The newReportChecks.cschecks:https://127.0.0.1:1, offline)python -I tests/test_release.py: 29 tests pass.dotnet build App -c Release -p:RestoreLockedMode=true -warnaserrorandtools/screenshotsbuild.SHA256SUMSrequest with its status and time), and through a dead proxy (the report above).🤖 Generated with Claude Code
Screenshots, drawn with
tools/screenshots(each scene's name in brackets):The update check failed, on the empty home (

home-check-failed)A notice on Home: the launcher's own update failed (

home-notice)Step 1, the tools' download failed (

tools-failed)The game closed unexpectedly (

crash)Importing Hookshot's saves failed (

hookshot-import-problem)Reviewed head
5d17d4b925. The shared report formatter, bounded in-memory log and explicit clipboard action are useful for diagnosing the current network failures. The original build report's useful context is retained, and the screenshot search opt-out avoids discovering real game files for illustrations.One required fix: the new home-path redactor does not handle Windows paths using forward slashes and does not enforce a directory-component boundary. See the inline comment for reproducible synthetic examples. These reports are intended for sharing; the stated username scrubbing needs to cover the path forms that diagnostics can contain.
Independent Windows validation, .NET SDK 10.0.401:
Environment notes: the first core invocation incorrectly requested --strict without its required --longshot argument and did not execute the suite. After that was corrected, the suite stopped at signature verification because this PC's Git autocrlf converted the signed SHA256SUMS fixture to CRLF. Running with its exact committed bytes passed; no signature check or test assertion was weakened. The first release invocation lacked OpenSSL on PATH; the corrected run above passed. The isolated checkout was left clean after testing.
Not tested: Linux execution, a live Launcher window or clipboard interaction, the screenshot tool build, real save import/build failures, or live service/proxy failures. No game, real save transfer, release or deployment was run.
@ -0,0 +52,4 @@var h = home?.TrimEnd('/', '\\');if (string.IsNullOrEmpty(h) || h.Length <= 3) return text;var windows = h.Contains('\\') || (h.Length > 1 && h[1] == ':');return Regex.Replace(text, Regex.Escape(h) + @"(?![\w.-])", "~", windows ? RegexOptions.IgnoreCase : RegexOptions.None);[P2] Match Windows separator variants and a complete home-directory component before copying the report. Against the actual built Core assembly, Scrub("C:/Users/Pat/work/build.log", @"C:\Users\Pat") returns the original string, and BugReport.Make retains that username in its copied build-log section; file:///C:/Users/Pat/... is likewise unchanged. Windows diagnostic paths can use forward slashes even though SpecialFolder.UserProfile supplies backslashes. The current negative lookahead also treats a space as a boundary, so @"C:\Users\Pat Smith\work\build.log" becomes @"~ Smith\work\build.log" even though it is a different home directory, contrary to the documented prefix rule. Please recognize both separators on Windows and replace only the exact home component (separator/end or an appropriate path terminator), with regressions for forward-slash/file-URI input and a longer sibling containing a space.
A fix for futondestroyer's [P2] (the home-folder scrub), one commit on top of this branch's head
5d17d4b: madebyjordan/LongshotLauncher@5b9ca21b0f, branchfix/pr93-scrubon my fork. Maintainer edits are off here, so I couldn't push it to the PR. To take it:What changes in
BugReport.Scrub:On Windows, each separator of the home folder matches
\or/, also doubled (JSON-escaped). SoC:/Users/Pat/work/build.logbecomes~/work/build.logandfile:///C:/Users/Pat/xbecomesfile:///~/x.A space in the home folder also matches
%20, forfile://links.The home folder only matches as a whole folder. It must be followed by:
,;:;So
C:\Users\Pat Smith\work\build.log,Pat-x,Pat2,Pat.oldandPat%20Smithstay as they are.'C:\Users\Pat' is denied,Saved in C:\Users\Pat.,C:\Users\Pat is fulland(C:\Users\Pat)become~.One edge left. A sibling folder with two or more spaces before its next separator (
C:\Users\Pat Smith Jr\x) still reads as the home folder followed by prose, so it becomes~ Smith Jr\x. It now errs toward hiding the name rather than leaving it.New checks in
ReportChecks.cs:file:///link, doubled separators, mixed case;Pat Smith,Pat%20SmithandPat-xsiblings;BugReport.Makewith a forward-slash path naming no user.Tested on Windows 11, .NET SDK 10.0.404:
python -I tests/test_launcher_core.pypasses 1158 checks (the symlink success fixtures are skipped without the privilege, as in the review). With the PR's originalBugReport.csand the new checks, it fails onC:/Users/Pat/work/build.log.Two Windows notes for whoever runs the checks:
core.autocrlf=truethe signedSHA256SUMSfixture checks out as CRLF. Re-checktests/fixtures/releaseout with-c core.autocrlf=false.%TEMP%as an 8.3 short path (JORDAN~1.DES), the portable-home check inInstallChecks.cs:181fails, becausePath.GetFullPathexpands the short name. Both happen on main too; neither is from this PR.