Skip to content

fix(reliability): review round 2 — boot-path logging, latch leaks, layout backup - #56

Merged
gyng merged 1 commit into
mainfrom
fix/review-round-2
Jul 9, 2026
Merged

fix(reliability): review round 2 — boot-path logging, latch leaks, layout backup#56
gyng merged 1 commit into
mainfrom
fix/review-round-2

Conversation

@gyng

@gyng gyng commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Items 1–6 from the post-0.0.50 review:

  1. No startup failure is console-only anymore — `useStudioInit`'s init catch (the choke point for every overlay init failure) and Canvas `reloadLayout`'s catch now route through `log_client` to the persistent log.
  2. Recovery latch leak fixed — keepalive/displaywatch reset `RESPAWN_PENDING` when the main-thread dispatch itself fails; a stuck flag would have silently disabled recovery for the rest of the process.
  3. displaywatch failures are visible — `RegisterClassW`/`CreateWindowExW` bails now log a warn (a dead watcher looked identical to a healthy one).
  4. `log_client` input caps — message 4096 chars / component 64, char-safe truncation (pure seam + test), so a buggy render loop can't churn the 1 MiB log rotation.
  5. Corrupt-layout backup — new `backup_layout` command copies `widgets.json` → `widgets.json.bad-` (newest 3 kept; pure prune seam + test) the moment the frontend fails to parse it, before the in-memory default layout can be saved over the original. Wired from both parse sites, once per session; read-failures (nothing to copy) skip it.
  6. `recreateMain` retries once (2s) on a transient layout-read failure — studio-close is the only recreate attempt while secondaries keep windows alive, so a single hiccup used to strand the primary until the next layout edit.

Verified: `cargo test` 202 (2 new) / `clippy` / `fmt` clean; `tsc`, oxfmt+oxlint (0 warnings), 2769 unit tests, build.

🤖 Generated with Claude Code

…yout backup

Items 1-6 from the post-0.0.50 review:

1. The last two console-only boot-path failure sinks now go through
   log_client: useStudioInit''s init catch (the choke point for EVERY overlay
   init failure) and Canvas reloadLayout''s catch. No startup failure is
   console-only anymore.
2. keepalive.rs / displaywatch.rs: reset RESPAWN_PENDING when the
   run_on_main_thread dispatch itself fails — a stuck flag would have
   silently disabled recovery for the rest of the process.
3. displaywatch.rs: RegisterClassW / CreateWindowExW failures now log a warn
   instead of bailing silently (a dead watcher looked identical to a healthy
   one).
4. log_client caps client-supplied strings (message 4096 chars, component 64,
   char-safe truncation; pure seam + test) so a buggy render loop can''t churn
   the 1 MiB log rotation.
5. backup_layout command: when the frontend fails to PARSE widgets.json it
   backs the file up (widgets.json.bad-<epoch-ms>, newest 3 kept — pure
   prune seam + test) BEFORE the in-memory default layout can be saved over
   whatever was hand-recoverable. Wired from both parse sites, once per
   session; invoke-failures (nothing readable to copy) skip the backup.
6. recreateMain retries once (2s) on a transient layout-read failure before
   leaving main down — studio-close is the only recreate attempt while
   secondaries keep windows alive, so a single hiccup used to strand the
   primary until the next layout edit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gyng
gyng merged commit 1359ebc into main Jul 9, 2026
4 checks passed
@gyng
gyng deleted the fix/review-round-2 branch July 9, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant