fix(onboarding): guard get_status so a daemon hiccup cannot freeze the wizard#77
Open
FourthWiz wants to merge 1 commit into
Open
fix(onboarding): guard get_status so a daemon hiccup cannot freeze the wizard#77FourthWiz wants to merge 1 commit into
FourthWiz wants to merge 1 commit into
Conversation
…e wizard The get_status daemon call in onMount was the only unguarded daemon call in the onboarding wizard's initialization sequence. When it throws (e.g. no auth token yet on a fresh install, since ensureDaemonCompatible's rejection is cached in the root layout before the wizard even mounts), the callback unwinds before the status event listener, calibration profile load, and TTS init ever register — leaving the wizard permanently frozen with a disconnected-looking device status and no way to proceed. Wrap the call in try/catch (console.error only, no new user-facing string) so the rest of onMount continues to run even when this one call fails.
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.
src/routes/onboarding/+page.svelte'sonMountmakes several daemon calls;get_status(line ~791) was the only one left unguarded — every other call inonMountis already wrapped in try/catch. When it throws, the callback unwinds before the status event listener, calibration profile load,tts_init, and the daemon event handler ever register —statusstays frozen at its initial placeholder value forever,isConnectedstays permanently false, and the wizard shows "Ready/Scanning" with grey electrodes that can never update, because nothing is listening for real device data anymore.This is a structural first-run reachability issue, not a rare race:
ensureDaemonCompatible()runs in the root layout on every app start, before any route mounts, and its.catchonly toasts — it never invalidates the cache. On a fresh install with no auth token yet, that promise rejects and stays cached, so the onboarding wizard's ownget_statuscall is guaranteed to throw the first time a user runs the app.Changes
get_statuscall in a baretry { ... } catch (e) { console.error(e); }. No new user-facing string (scoped deliberately — this repo's i18n gate is expensive to trigger for a 3-line fix).Testing
No vitest host currently covers
onboarding/+page.svelte; inventing one for a 3-line guard would exceed the fix's blast radius, so this is stated rather than papered over with a token test.Related
Changelog fragment included:
changes/unreleased/fix-onboarding-get-status-guard.md(Bugfixes).