Conversation
- Added isLoading and isHasDevice properties to the useConfig hook. - Updated tests for useConfig to verify loading and device status. - Modified MemoryScaleFactorPreview and GeneratorConfigHiresFixUpscaler tests to include new properties. - Refactored HealthCheck component to utilize useHealthCheck for routing logic based on health and config status. - Created useHealthCheck hook to encapsulate health check logic and routing behavior. - Updated HealthCheck tests to reflect changes in routing logic.
Enhance useConfig hook with loading and device status
## [1.18.0-beta.1](v1.17.0...v1.18.0-beta.1) (2025-12-15) ### Features * enhance useConfig hook with loading and device status ([0b18031](0b18031)) ### Bug Fixes * mark manual tests as completed for health check validation ([2334293](2334293))
…ll for process termination
…ion and update related tasks
Resolve backend shutdown hang on Windows by implementing tree-kill for process termination
## [1.18.0-beta.2](v1.18.0-beta.1...v1.18.0-beta.2) (2025-12-15) ### Bug Fixes * mark Linux manual test as completed and update pnpm version in package.json ([f56baee](f56baee)) * replace fkill with tree-kill for cross-platform process termination and update related tasks ([c0193a9](c0193a9)) * resolve backend shutdown hang on Windows by implementing tree-kill for process termination ([3f7cd25](3f7cd25)) * update documentation and tests to use tree-kill for backend process termination ([2ef2358](2ef2358))
Resolve test runner warnings by updating test patterns and mocking strategies
## [1.18.0-beta.3](v1.18.0-beta.2...v1.18.0-beta.3) (2025-12-15) ### Bug Fixes * resolve test runner warnings by updating test patterns and mocking strategies ([4e65139](4e65139))
|
🎉 This PR is included in version 1.18.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Pull request overview
This release PR (v1.18.0-beta.3) addresses three major quality improvements: eliminating test warnings through proper React Testing Library patterns and mock refinements, fixing a race condition in the health check flow that caused the setup wizard to incorrectly reappear after updates, and resolving a critical backend process termination issue on Windows. The changes also include dependency updates (pnpm 10.25.0, React 19.2.3, various @heroui and @TanStack packages) and extract complex routing logic into reusable hooks following established architecture patterns.
Key changes:
- Wrapped state updates in
act(), suppressed intentional console errors in tests, and fixed HeroUI mock components to prevent DOM warnings - Added
isLoadingandisHasDevicetouseConfighook and createduseHealthCheckhook to properly sequence health check and config loading before routing decisions - Replaced platform-specific process termination with
tree-killpackage for reliable cross-platform backend shutdown
Reviewed changes
Copilot reviewed 48 out of 49 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.mts | Removed concurrency settings (maxConcurrency, maxWorkers, minWorkers) to improve test stability |
| src/features/settings/states/tests/useUpdaterSettings.test.ts | Added console.error suppression in error handling test blocks using beforeEach/afterEach pattern |
| src/features/settings/presentations/tabs/tests/UpdateSettings.test.tsx | Added console.error spy for update check error test |
| src/features/model-search/presentations/tests/ModelSearchViewFiles.test.tsx | Destructured removeWrapper prop in Table mock to prevent DOM leakage |
| src/features/model-search/presentations/tests/ModelSearchOpenIconButton.test.tsx | Wrapped button.focus() in act() to prevent React warnings |
| src/features/model-search/presentations/tests/ModelSearchInput.test.tsx | Added waitFor for form state stabilization |
| src/features/health-check/states/useHealthCheck.ts | New hook extracting health check logic and routing from component |
| src/features/health-check/states/index.ts | Exported new useHealthCheck hook |
| src/features/health-check/states/tests/useHealthCheck.test.ts | Comprehensive tests for useHealthCheck hook behavior |
| src/features/health-check/states/tests/useBackendSetupStatus.test.ts | Wrapped event listener state update in act() |
| src/features/health-check/presentations/tests/HealthCheck.test.tsx | Refactored tests to use useHealthCheck mock instead of individual hooks |
| src/features/health-check/presentations/HealthCheck.tsx | Simplified component by delegating logic to useHealthCheck hook |
| src/features/gpu-detection/presentations/tests/GpuDetection.test.tsx | Updated test description and expectation to reflect actual behavior |
| src/features/generators/presentations/tests/Generator.test.tsx | Wrapped Zustand setState calls in act() |
| src/features/generator-previewers/presentations/tests/GeneratorPreviewerItem.test.tsx | Destructured isIconOnly prop in Button mock |
| src/features/generator-config-styles/presentations/tests/GeneratorConfigStyleModal.test.tsx | Changed vi.waitFor to RTL waitFor and destructured onOpenChange prop |
| src/features/generator-config-styles/presentations/GeneratorConfigStyleModal.tsx | Reformatted interface declaration for readability |
| src/features/generator-config-hires/states/tests/useGeneratorConfigHiresFixUpscaler.test.ts | Added isLoading and isHasDevice to useConfig mock |
| src/features/generator-config-hires/presentations/tests/GeneratorConfigHiresFixUpscaler.test.tsx | Removed nested span from SelectItem mock, updated tests to use data-description attribute |
| src/features/generator-config-formats/states/tests/useGeneratorConfigFormats.test.ts | Added isLoading and isHasDevice to useConfig mock |
| src/features/generator-actions/presentations/tests/GeneratorAction.test.tsx | Simplified SelectItem mock by removing key prop |
| src/features/extra-loras/states/tests/useLoraCard.test.tsx | Wrapped setWeight calls in act() |
| src/cores/test-utils/next-image.tsx | Destructured additional props (fill, priority, loading, quality, className) in MockNextImage |
| src/cores/sockets/tests/useSocketEvent.test.ts | Wrapped Zustand setState in act() |
| src/cores/presentations/memory-scale-factor/tests/MemoryScaleFactorPreview.test.tsx | Added isLoading and isHasDevice to useConfig mock |
| src/cores/presentations/NumberInputController.tsx | Reformatted interface declaration for readability |
| src/cores/hooks/useConfig.ts | Added isLoading from query and isHasDevice derived value to return type |
| src/cores/hooks/tests/useConfig.test.ts | Added comprehensive tests for new isLoading and isHasDevice fields |
| src/app/tests/providers.test.tsx | Mocked BackendLogCollector to prevent act() warnings |
| scripts/devall.ts | Added --success first to concurrently for clean exit handling |
| scripts/backend/run-backend.ts | Replaced platform-specific kill logic with tree-kill package, made stopBackend async |
| scripts/backend/tests/run-backend.test.ts | Updated tests for async stopBackend and tree-kill usage |
| scripts/tests/electron.test.ts | Added console.error suppression for error path tests |
| package.json | Updated version to 1.18.0-beta.3, added tree-kill dependency, updated multiple dependencies |
| openspec/specs/testing-quality/spec.md | Added new spec documenting test quality requirements |
| openspec/changes/fix-test-warnings/* | Comprehensive documentation of test warning fixes |
| openspec/changes/fix-health-check-config-race/* | Documentation of health check race condition fix |
| openspec/changes/fix-backend-shutdown-hang/* | Documentation of backend shutdown improvements |
| electron/main.ts | CRITICAL ISSUE: Refactored to use main() pattern but introduced potential infinite loop in before-quit handler |
| docs/CODING_STYLE.md | Added import convention to prefer barrel files over individual imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| app.on('before-quit', async (event) => { | ||
| console.log('App is quitting, stopping backend...') | ||
| stopBackend() | ||
| event.preventDefault() | ||
| await stopBackend() | ||
| app.exit(0) | ||
| }) |
There was a problem hiding this comment.
The before-quit event handler has a critical bug that causes an infinite loop. The handler calls event.preventDefault() and then app.exit(0), but on subsequent quit attempts (triggered by app.quit() in window-all-closed), the handler will be called again, creating a loop.
The fix is to use a flag to track if the cleanup has already been done:
- Add a
let isQuitting = falsevariable at module level - Check if
isQuittingis true at the start of the handler and return early if so - Set
isQuitting = truebefore calling stopBackend()
This ensures the cleanup happens only once and the app exits properly.
No description provided.