Skip to content

fix win config issue#22

Merged
newbe36524 merged 1 commit intomainfrom
fixwin
Feb 16, 2026
Merged

fix win config issue#22
newbe36524 merged 1 commit intomainfrom
fixwin

Conversation

@newbe36524
Copy link
Contributor

@newbe36524 newbe36524 commented Feb 16, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Enhanced Windows compatibility for configuration files with paths containing spaces or special characters.
    • Added dependency status validation before starting web services to catch missing dependencies early.
  • Performance

    • Implemented caching layer for dependency checks to reduce redundant verification calls.

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The changes enhance dependency management and web service initialization across multiple layers. Key updates include: conditional dist removal via Node.js in the dev script, Windows path sanitization for YAML output, dependency check caching with cache invalidation, pre-startup dependency validation, Windows path quoting for spawn commands, and consolidated dependency fetching with payload-based thunk signatures.

Changes

Cohort / File(s) Summary
Dev Script Optimization
package.json
Changed dist removal from shell command (rm -rf dist) to conditional Node.js removal using fs.rmSync with existence check.
Windows Path Handling
src/main/config-manager.ts
Added sanitizeConfigForYaml() and escapePathForYaml() methods to escape Windows paths in YAML output; writeConfig() now sanitizes config before dump.
Dependency Caching & Validation
src/main/dependency-manager.ts
Introduced caching layer for dependency checks with TTL-based invalidation; added clearCheckCache() public method; updated result file lookup to use script directory; integrated cache clearing post-install operations.
Onboarding Service Startup
src/main/onboarding-manager.ts
Added pre-check validation in startWebService() to verify dependency status before initiating service startup; returns early with error if dependencies not 'installed-ready'.
Process Spawning for Windows
src/main/web-service-manager.ts
Added path quoting logic for Windows when script path contains spaces; enforces shell: true, detach mode, and windowsHide for Windows startup scripts.
Dependency Fetching
src/renderer/store/thunks/dependencyThunks.ts
Refactored to fetch all dependencies via getAllDependencies() and filter for missing/mismatched items; consolidated onboarding population logic.
Renderer Integration
src/renderer/components/onboarding/steps/DependencyInstaller.tsx
Updated installFromManifest() dispatch to pass structured payload ({ versionId, context }) instead of version string.

Sequence Diagram(s)

sequenceDiagram
    participant Renderer as Renderer UI
    participant Thunk as Dependency Thunk
    participant MainProc as Main Process
    participant FileSystem as File System
    participant Cache as Cache Layer

    Renderer->>Thunk: installFromManifest({versionId, context})
    Thunk->>MainProc: batchInstallDependencies(versionId)
    MainProc->>FileSystem: Execute install scripts
    FileSystem-->>MainProc: Installation result
    MainProc->>Cache: clearCheckCache()
    Cache-->>MainProc: Cache cleared
    MainProc-->>Thunk: Install complete
    Thunk->>MainProc: checkAllDependencies(versionId)
    Cache->>Cache: Check TTL validity
    alt Cache hit & valid
        Cache-->>Thunk: Cached result
    else Cache miss or expired
        MainProc->>FileSystem: Read check-result.json
        FileSystem-->>MainProc: Check result
        MainProc->>Cache: Store result with timestamp
        MainProc-->>Thunk: Fresh result
    end
    Thunk-->>Renderer: Dependency state updated
Loading
sequenceDiagram
    participant Onboarding as Onboarding Manager
    participant DepChk as Dependency Check
    participant WebSvc as Web Service Manager
    participant Process as OS Process
    
    Onboarding->>DepChk: Validate version.status
    DepChk-->>Onboarding: Status + missing dependencies
    alt Status not 'installed-ready'
        Onboarding-->>Onboarding: Compute missing/mismatched deps
        Onboarding-->>Onboarding: Return error (early exit)
    else Status 'installed-ready'
        Onboarding->>WebSvc: executeStartScript(scriptPath)
        WebSvc->>WebSvc: Detect spaces in Windows path
        alt Windows + spaces detected
            WebSvc->>WebSvc: Quote script path
            WebSvc->>WebSvc: Use shell: true, detach, windowsHide
        else Unix or no spaces
            WebSvc->>WebSvc: Standard spawn options
        end
        WebSvc->>Process: Spawn service process
        Process-->>WebSvc: Process spawned
        WebSvc-->>Onboarding: Service started
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Poem

🐰 A cache born, paths now clean and bright,
Windows paths escaped—no more a fright!
Deps validated before the service takes flight,
Consolidated fetches burning oh so right,
This little rabbit hops with all her might!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fixwin

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@newbe36524 newbe36524 merged commit 7eb7e45 into main Feb 16, 2026
2 of 3 checks passed
@newbe36524 newbe36524 deleted the fixwin branch February 16, 2026 09:50
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