Skip to content

fix(studio): surface write/reload errors, restore debounce, avoid mutex poisoning#30

Merged
LeadcodeDev merged 1 commit into
mainfrom
fix/studio-reliability
Jul 18, 2026
Merged

fix(studio): surface write/reload errors, restore debounce, avoid mutex poisoning#30
LeadcodeDev merged 1 commit into
mainfrom
fix/studio-reliability

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #13.

Goal: the studio never lies — failed writes and failed reloads are visible, and a render panic cannot kill the session.

  • Silent writes: perform_write returns Result; on failure StudioModel::write_error (new field) is set, generation bumped, and the topbar renders "Changes not saved: " in --rm-error. Annotation submit/delete follow the same path. (save_recents stays best-effort by design — MRU cache, not a document.)
  • Mute reloads: the watcher now matches on load_input; parse errors surface through the pre-existing error banner instead of leaving stale frames.
  • Debounce restored (lost in the studio rework): one shared WriteDebounce slot; each edit cancels the pending task and schedules a 250ms-delayed write — last value wins, content and property edits both covered.
  • Poisoning: the frame asset handler wraps render_frame in catch_unwind (sound: render_frame takes the model immutably) and answers HTTP 500 on panic; every .lock().unwrap() in the crate replaced with poison-recovering unwrap_or_else(|e| e.into_inner()).

Verify: cargo check -p rustmotion-studio ✓ · cargo test --workspace → 138 passed ✓ · cargo fmt --check ✓ · clippy 0 warnings ✓

…der panics

- perform_write returns Result; failures set StudioModel::write_error
  and the topbar shows 'Changes not saved: <reason>' (annotations too)
- watcher reload errors now surface through the existing error banner
  instead of silently keeping stale frames
- inspector property and content writes debounced (250ms, last value
  wins) restoring the behavior lost in the studio rework
- asset handler wraps render_frame in catch_unwind (render_frame is
  immutable over the model, so AssertUnwindSafe is sound) and returns
  HTTP 500 on panic; all studio lock() sites recover from poisoning
  via unwrap_or_else(into_inner)
@LeadcodeDev
LeadcodeDev merged commit bb14797 into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the fix/studio-reliability branch July 18, 2026 20:12
LeadcodeDev added a commit that referenced this pull request Jul 18, 2026
Closes #16. Sidecar with identical annotation format, merged at every load path (studio, load_input, CLI validate), PR #30 write guarantees, skill updated.
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.

fix(studio): surface write/reload errors, restore debounce, avoid mutex poisoning

1 participant