Repository navigation
Studio reloads itself once when its window never finishes starting, and says so - #1340
Merged
Merged
Conversation
…shes, and says so A classic script in index.html, loaded before main.js, waits 20 s for main.js's boot to call window.dodStudioBoot.done(). If it doesn't, the page reloads once with a banner and an activity log line; stuck again, the banner says to restart Studio and it stops there. A normal start logs how long it took. Unit tests for the logic, e2e tests for a normal boot and for one whose module never arrives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Tested in a real Studio window ( #1340, boot watchdog
#1341, start-up prompts
|
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.
Release note: Fixed: if Studio's window ever opens without finishing its start-up (every button dead), it now reloads itself once and tells you, instead of sitting there.
What happened
After a hard reset,
npm run tauri devopened a window where nothing worked: no error in the console, the backend answeringget_settingsat once. The page had loaded 76 of its 239 scripts and waited on the rest for good, somain.jsnever ran. Nothing said so anywhere.What changes
studio/public/boot_watchdog.js, a classic script loaded fromindex.htmlbeforemain.js, so it runs when the modules don't.main.jscallswindow.dodStudioBoot.done()as the last step of its boot.done()within 20 s: a banner says Studio is reloading, the activity log gets[boot] Studio's page didn't finish starting in 20 s (N of its scripts loaded): reloading it once, and the page reloads.[boot] Studio's page started in N ms.It catches any start that stops short, not just hung downloads: an exception in
main.js's boot, or a start-up call that never answers, leavesdone()uncalled too.Decisions
strings.js. The catalog is a module, and this runs exactly when modules don't. Named constants at the top of the file.tauri devstart, Vite bundling every dependency first, isn't mistaken for a hang. A release start takes about a second.main_js_budget523 → 525 for thedone()call and its comment, which have to sit at the end of the boot itself.vite build:dist/boot_watchdog.js), for the other ways a start can stop.Test done
boot_watchdog.test.js(6): a normal start, one reload, stuck again, the marker cleared, a late finish, a finish during the reload line.app-boot.spec.js: a normal boot reachesstartedwith no banner; with one ofmain.js's imports never answering, the page reloads once and then shows the restart banner.npm run test:unit(1,424 passed), all e2e (521 passed),eslint(no errors).vite build: the watchdog is copied todistand loaded before the bundle.Not tested: inside a real Tauri window (the e2e harness is a plain browser with mocked IPC, so the log line goes to the console there).
Your test (2 min)
npm run tauri devfrom this branch.[boot] Studio's page started in N ms.🤖 Generated with Claude Code