Skip to content

fix(browse): reset profile crash markers so headed launch stops showing the profile-error bubble - #2672

Open
crsc1 wants to merge 1 commit into
garrytan:mainfrom
crsc1:fix/chromium-profile-crash-bubble
Open

fix(browse): reset profile crash markers so headed launch stops showing the profile-error bubble#2672
crsc1 wants to merge 1 commit into
garrytan:mainfrom
crsc1:fix/chromium-profile-crash-bubble

Conversation

@crsc1

@crsc1 crsc1 commented Aug 22, 2026

Copy link
Copy Markdown

Headed Chromium shows "Something went wrong when opening your profile. Some features may be unavailable." over the page on most launches. It lands in screenshots and swallows clicks near the top of the viewport, so /browse --headed QA has to dismiss it first.

Cause: close() falls back to SIGKILL when a graceful shutdown overruns closeRaceMs (browser-manager.ts), so Default/Preferences keeps exit_type: "Crashed". Chromium reports the unclean profile on the next launch.

cleanSingletonLocks() already handles the half of this that blocks launch outright. This adds resetProfileExitState() beside it in config.ts, sharing the same directory guard via an extracted resolveRecognizedProfileDir(), and calls it from both launchPersistentContext paths (launchHeaded and the handoff path).

--hide-crash-restore-bubble (browser-manager.ts:547, :1711) does not cover this one. That flag suppresses the session-restore bubble; the profile-error bubble reads the profile's own stored exit state, so it has to be reset on disk. Confirmed by testing the flag against a Crashed profile.

Notes:

  • Parses and rewrites the Preferences JSON rather than regexing it, so unrelated keys survive.
  • No-ops on a missing, corrupt, or already-clean profile; never throws.
  • Respects $CHROMIUM_PROFILE, so gbrowser per-workspace profiles are covered.
  • 8 tests added to browse/test/config.test.ts. Full bun run scripts/test-free-shards.ts is green apart from 3 pre-existing brain-cache-roundtrip failures that import nothing in this diff.

Related but not the same: #2311 (SingletonLock in handoff), #2492 (per-project headed profile). Should merge cleanly with either.

…howing the profile-error bubble

close() SIGKILLs Chromium when a graceful shutdown overruns closeRaceMs, so
Default/Preferences is left with exit_type "Crashed". The next headed launch
paints "Something went wrong when opening your profile" over the page, which
lands in screenshots and swallows clicks near the top of the viewport.

cleanSingletonLocks() already handles the half of this that blocks launch
outright. This adds resetProfileExitState() next to it, sharing the same
directory guard, and calls it from both persistent-context launch paths.

--hide-crash-restore-bubble does not cover this: that flag suppresses the
session-restore bubble, while the profile-error bubble reads the profile's
own stored exit state, so it has to be reset on disk.
@trunk-io

trunk-io Bot commented Aug 22, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant