Repository navigation
Set the desktop app name before awaiting host toolchain discovery - #6389
Merged
ymichael merged 1 commit intoOct 27, 2026
Merged
Conversation
runDesktopApp awaited hostToolchain.refresh() before app.setName(), so Electron reached ready with its default name and locked the profile to ~/Library/Application Support/@bb/desktop. Updated nightlies lost the saved server, Connect credential and window state and fell back to This Mac. Name the app, take the single-instance lock and register handlers first, then await discovery just before whenReady(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/fix-server-connection-persistence-thr_hd2udn5vff
branch
October 27, 2026 19:00
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.
Human comments
What was wrong
#6194 changed the start of
runDesktopApp(apps/desktop/src/main.ts) from a synchronous PATH fixup toawait hostToolchain.refresh(), and that await ran beforeapp.setName(DESKTOP_RELEASE_INFO.applicationName). The refresh spawns a login shell, so Electron reachedreadywhile it ran. Electron then locked the profile directory to the default name from the packagedpackage.json,@bb/desktop. Updated nightlies started with an empty profile at~/Library/Application Support/@bb/desktop/instead ofbb Nightly/. That profile has no saved server (server-target.json), no Connect credential (log showsconnect server sync skipped (no-credential)) and no window state, so the app fell back to This Mac with no other servers listed. The real profile is untouched:bb Nightly/server-target.jsonstill holds the user's saved target. Stable 0.47.1 predates #6194 and is not affected.What changed
apps/desktop/src/main.ts:runDesktopAppnow sets the app name, installs the About panel, takes the single-instance lock and registers app/process handlers before any await. The packaged host toolchain refresh moved to just beforeawait app.whenReady(), so the profile name is fixed however long discovery takes. Child processes still receive the discovered environment before anything is spawned.When this build is installed, existing users go back to their original
bb Nightly/bbprofile, so nothing needs migrating. Anything chosen in the interim@bb/desktopprofile stays behind.There are no wire, CLI, or doc changes.
How you verified
0.47.2-nightly.40533619938.1, a new~/Library/Application Support/@bb/desktop/profile appeared, holding theSingletonLockand noserver-target.json. The oldbb Nightly/profile still hastarget: "custom", last written Oct 21.pnpm exec turbo run typecheck lint test --filter=@bb/desktop: passes (599 tests passed, 1 skipped).--user-data-dir, so it cannot catch the default profile path. A packaged nightly with this change has not been launched yet.🤖 Generated with Claude Code