Skip to content

Keep the slicer saved in Settings when a slow slicer check finishes - #189

Merged
vycdev merged 1 commit into
developfrom
fix/issue-186-slicer-check-race
Nov 19, 2026
Merged

vycdev merged 1 commit into
developfrom
fix/issue-186-slicer-check-race

Conversation

@vycdev

@vycdev vycdev commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Fixes #186

If Open in Slicer was still checking the saved slicer when a new one was saved (or forgotten) in Settings, the late result undid that choice: a missing old slicer cleared the slicer just saved, and a found one opened the model in the replaced slicer.

useSlicerChoice now keeps the latest preference in a ref, updated in updatePreference. onOpenInSlicer reads it when it starts and drops the lookup result (found, missing, or error) if the preference changed during the lookup. The storage key and format are unchanged.

Proof: new tests/useSlicerChoice.test.ts holds find_slicer_app with a deferred promise, saves a new slicer, then releases the lookup as missing and as found. Both cases fail on develop and pass with the fix. npm run lint, tsc -b, npm test, check:i18n, and the open-in-slicer.spec.ts @smoke e2e (6/6) pass.

Reviewed with sol-loop: 1 round with gpt-6.2-sol. Sol verdict: approved

🤖 Generated with Claude Code

Open in Slicer awaited findSlicerApp with the preference it started with and
then acted on the result unchecked, so saving or forgetting a slicer in
Settings meanwhile could be undone (missing: preference cleared) or ignored
(found: model opened in the replaced slicer). Track the latest preference in
a ref and drop the result when it changed during the lookup.

Fixes #186

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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