perf(electron): look up the login shell PATH without blocking the main thread

fix-path ran $SHELL -ilc env synchronously right after the first load.
With a typical zsh profile that held the main thread for 1-2 s, while the
database worker's ready message and the renderer's first IPC calls waited,
so the launch journey's first card came that much later. Use shell-path's
async shellPath() with fix-path's fallback, so the resulting PATH is the
same and the main thread stays free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5.5 committed 2026-10-01 06:44:56 +02:00
1 parent adb4889b0f
commit 004b0a3a98
8 files changed
+198 -65

No files matched your search

+11
View File
@@ -281,6 +281,17 @@ process before the first card.
completion bumps `EpgSourceSettingsService.revision()`, the fence that
keeps XMLTV lookups from returning data of a removed source.
- The main thread must stay free between the load and the first card. The
renderer's first database read creates the database worker, and every
request waits until the main process has handled the worker's `ready`
message. Until #NNNN the login-shell PATH lookup (`fix-path`) ran right
after `bootstrap-events:done` and spawned `$SHELL -ilc env` synchronously:
on a Mac with a typical zsh profile it held the main thread for about
1-2 s, the first `dbGetAppState` resolved about 2.3 s after spawn, and
everything after it (about 20 ms of IPC) waited. It now runs the shell
asynchronously (`startup/login-shell-path.ts`). On Linux runners bash
starts in tens of milliseconds, so the effect there is small.
Validation (#1716, Principle 3): deferring the download list, update status
and dashboard recent/favorites reads until after the first render took the
counter from 12 to 7 on a Mac, but moved neither `spawnToFirstCardMs` nor