Repository navigation
feat: show StableBar's crashes in Settings and copy them into a bug report - #338
Merged
Merged
Conversation
…eport StableBar reported no crashes: one on someone's Mac stayed invisible unless they filed an issue and found the crash log themselves. StableBar now reads the crash reports macOS writes for it, in ~/Library/Logs/DiagnosticReports and its Retired folder, where they are. Settings → Status → Crashes lists the last 30 days with Copy report, Report on GitHub…, Show in Finder and Dismiss. Report on GitHub opens the bug report form with the crash filled in, and nothing is sent until the user submits it. After a new crash, the status menu shows "StableBar Quit Unexpectedly…" until the crash is seen. StableBar stores only which crashes were seen or dismissed. `StableBar triage` lists recent crashes in its context file. Fixes #333
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.
Problem
StableBar reports no crashes. When it crashes on someone's Mac, nobody learns why unless that person files an issue and finds the crash log on their own. StableBar sends no data, so crash reports have to stay on the Mac unless the person chooses to share one. Fixes #333.
Changes
CrashReportparses the.ipsfile macOS writes after every crash: a JSON header line, then a JSON body. It keeps only StableBar's crash reports (bug_type309,app_nameStableBar) and reads the version, macOS, Mac model, exception, termination, Swift's error message and the crashing thread's frames. Other apps' reports, hang reports and files macOS is still writing are skipped. MetricKit is left out: it delivers only when the user shares analytics with app developers, which is off on most Macs.CrashReports(onBarStore) reads~/Library/Logs/DiagnosticReportsand itsRetiredfolder off the main actor. It refreshes at launch, when a menu opens and when Crashes is shown. A report in both folders counts once. StableBar stores onlycrashReportsSeenThroughanddismissedCrashReportsin its defaults, and macOS removes old reports on its own.ConfigurationEditor.diagnosticSelection(overview, crashes or a widget), so a widget namedcrashescan't collide with the new row.~. Report on GitHub opensbug_report.ymlin the browser with the title, What happens, Environment and Evidence filled in. Nothing is sent until the user submits the form. Long Swift symbols, deep stacks and long messages are cut so the link stays under 8,000 characters and the title under GitHub's 256.StableBar triagelists the last 30 days of crashes (time, exception, where, build, file name) in its context file.docs/settings.mddescribes Crashes.docs/command-line.mdnotes that triage includes crashes, and the bug report form's Evidence field asks for the copied report when StableBar quit.--reportfollow in a second pull request stacked on this one, with recent crashes included.Testing
CrashReportTests, each seen failing first, cover:sourceFile/sourceLineand a build with an empty version;+) and length for deep stacks, a 20,000-character message and a 2,700-character symbol;TriageTestscovers the new context lines..ipsfiles on this Mac, from test-runner crashes renamed to StableBar. A separate review repeated that check on three more.swift teston this branch, rebased onmain(068b6fc): 294 XCTest and 482 Swift Testing tests pass.swift build -c release --disable-keychainbuilds.main) and after. The app wasn't launched.CrashReports.noteandmenuWillOpen;id, and the ids matchbug_report.yml.git diff --checkand commitlint on the full message pass.Merging
A merge commit or rebase merge, which keeps the one commit. As a
feat, it makes a minor release.Claude Opus 5.5 via Claude Code