fix(firstrun): stop the setup screen timing out while it waits for you (#1376) - #1403
Conversation
#1376) The splash flips any stage that sits still past a budget to `failed`, so a wedged bootstrap surfaces Retry and logs instead of an info-less spinner (#879). Right for every stage the machine owns. `awaiting_setup` is not one of them. Rust parks there deliberately — "nothing downloads or installs in this stage, complete_setup is the only way out of it" — and waits for a human to choose install mode, storage locations, region and mirrors. A screen built for deliberation, handed the default 120-second fuse. So reading the setup screen for two minutes produced "Setup failed — the backend never reported ready", replaced the setup screen, and stopped the IPC poll. Retry re-enters the bootstrap, which parks at awaiting_setup again and fails again on the same clock. Nothing the user can do escapes it, and it lands on the very first screen a new install ever shows — the one thing the project's core value says has to work. Reproduced live on a clean install: tauri.log ends at "awaiting setup screen confirmation", the app data dir is empty, and complete_setup's own "Setup complete — starting bootstrap" line never appears. Nothing was ever attempted; the UI gave up on the user. A stage only a person can leave cannot be judged stalled, so awaiting_setup gets no budget. Three tests: the setup screen survives ten minutes, it still hands off the moment the plan is submitted, and a genuinely wedged starting_backend still fails — so this does not trade #1376 for #879. Two fail before, in the reported failure mode. Frontend: 1703 passed. Gates clean.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe bootstrap stall policy now keeps the first-run setup stage active without a timeout. Existing timeout budgets remain for dependency installation and other stages. Tests cover prolonged setup, normal progression, and stalled backend startup. ChangesBootstrap timeout behavior
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 7 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (7 passed)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #1376.
The bug
BootstrapSplash.jsxflips any stage that sits still past a budget tofailed, so a wedged bootstrap surfaces Retry and logs instead of an info-less spinner (#879). That is correct for every stage the machine owns.awaiting_setupis not one of them:It is the screen where you pick install mode, storage locations, region and mirrors. Built for deliberation — and given the default 120-second fuse.
Read the setup screen for two minutes and the app declares "Setup failed — the backend never reported ready", replaces the setup screen, and
returns out of the IPC poll. Retry re-enters the bootstrap, which parks atawaiting_setupagain and fails again on the same clock.There is no way out by retrying, and it lands on the first screen a new install ever shows.
Reproduced live
On a clean
bun desktop-prodinstall, at the moment of failure:tauri.logends atFirst run — awaiting setup screen confirmation before installingcomplete_setup's own"Setup complete (…) — starting bootstrap"log line never appearsNothing was ever attempted. The UI gave up on the user, then blamed the backend.
Fix
A stage only a person can leave cannot be judged stalled, so
awaiting_setupgets no budget.AwaitingSetupis the only human-gated stage in the enum; every other one is bounded machine work and keeps its budget unchanged.Tests
Three, in
BootstrapSplashAwaitingSetupStall.test.jsx:expected 'failed' to be 'awaiting_setup')starting_backendstill fails — passes before and after, so this does not trade [Crash] Backend died (exit code 1) #1376 back for [Bug] After Windows BSOD/unclean shutdown, app stuck at "preparing" — WebView2 cache corruption blocks Tauri IPC custom protocol #879Frontend suite: 1703 passed. Typecheck, format and lint clean.
The setup screen no longer times out while users select an installation plan because
awaiting_setupis excluded from bootstrap stall detection. Machine-controlled stages retain their existing timeout limits, with tests covering prolonged setup, submission handoff, and stalledstarting_backenddetection. Review the timer exemption because setup can now remain active indefinitely if user input or setup progress never occurs.