feat(startup): log a single launch phase timeline per launch (#843) - #849
Merged
Conversation
Prod installs hit the 10s 'ready-to-show' fallback and the logs only said the deadline was missed, never which phase ate the time. Stamp each startup phase's offset from process start and emit them as one structured line when the window is revealed, so a slow launch is attributable from one record. - new launch-timeline.ts owns the marks, forwards each to the existing per-phase telemetry event, and emits the summary once - adds vault open start -> isOpen timing (the main-process work that is the prime suspect); reported as vaultOpenPending when still running at reveal - warn level on a fallback or >=5s reveal so it ships to the log sink, info otherwise so healthy launches stay local - allowlists the phase offset fields as numerics in shared redaction
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
h4yfans
marked this pull request as ready for review
July 22, 2026 16:22
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.
Closes #843.
Why
Prod installs hit the 10s
ready-to-showfallback (×6 / 4 installs, linux + win32, v2026.719.2) and the only log line said the deadline was missed — never which phase ate the time. Instrumentation-first: this makes the next triage round attributable.What
apps/desktop/src/main/launch-timeline.tsstamps each startup milestone's offset from process start and emits them as one structured line,launch timeline, when the window is revealed:appReadyMsapp.whenReady()startup work finishedwindowCreatedMsBrowserWindowconstructedvaultOpenStartMs/vaultOpenReadyMsisOpenrendererLoadedMsdid-finish-loadreadyToShowMsready-to-show(absent when it never fired)shownMsreasonready-to-show,fallback-timeout, ordid-fail-loadfallbacktruewhen the 10s fallback firedvaultOpenPendingNotes on the choices:
isOpen, not at theautoOpenLastVault()promise, which also waits on the first full sync.isOpenis the main-process work (migrations, indexing) that can actually block the reveal. A launch onto the picker records no vault phase at all, so it can't report a forever-pending open.warnwhen the reveal came from the fallback or took ≥5s,infootherwise. Onlywarn/errorreach the diagnostic log sink, so pathological launches ship and healthy ones stay local.recordLaunchPhase()still forwards every phase to the existingapp_launch_phase_completedtelemetry event — those dashboards are unchanged, and the existing "did not fire within 10s" warn line stays put.*Msfields are allowlisted as numerics in shared redaction, otherwise they'd ship as scrubbed text instead of numbers.Verification
vitest --project main— 4017 pass, 0 fail (5 new launch-timeline tests + fallback-reveal wiring assertion inindex.phase2.test.ts)@memry/contracts— 1524 pass, 0 fail (new redaction passthrough test)typecheck(desktop node + web, contracts),lint(0 errors),ipc:check, contract + architecture boundary checksdocs:impact --base origin/main --strict→ covered;docs:buildcleanFollow-up
Re-triage prod logs once a release carrying this is out — the slow phase names the real issue. Note #821 (embeddings off the vault-open blocking path) is merged but unreleased and is one of the candidate causes; if it lands in the same release,
vaultOpenReadyMsshould show it.🤖 Generated with Claude Code