Skip to content

Fix/critical bugs - #16

Merged
EduTiyo merged 2 commits into
mainfrom
fix/critical-bugs
Sep 20, 2026
Merged

EduTiyo merged 2 commits into
mainfrom
fix/critical-bugs

Conversation

@EduTiyo

@EduTiyo EduTiyo commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

This PR addresses critical bugs discovered in the terminal adapter scripts and TypeScript project reference build, while introducing atomic filesystem persistence, fault-tolerant project listing, and enhanced model validation rules.


Changes

1. Fixes & Terminal Adapter Isolation

  • Terminal Script Cleanups: Removed duplicate shebangs (#!/bin/zsh) and redundant shell environment sourcing (~/.profile, ~/.bashrc) in macOS and Linux script generators in crates/codelaunch-core/src/ide/terminal/mod.rs.
  • Workspace Directory Isolation: Updated TerminalAdapter::render to output files into output_dir.join(project.id.to_string()) (matching VsCodeAdapter). This eliminates filename collisions between projects sharing the same name and ensures delete_project cleanly purges orphaned terminal scripts.
  • Test Suite Deduplication: Removed accidentally duplicated assertion blocks in terminal/mod.rs tests and introduced a dedicated test verifying project ID collision prevention.

2. TypeScript Build & Composite References

  • Directive Cleanup: Removed the redundant // @ts-expect-error in vite.config.ts (since @types/node is present), resolving TS2578 failures.
  • Project Reference Validation: Updated npm run build to invoke tsc -b && vite build so tsconfig.node.json and composite project references are verified in CI.
  • Build Artifact Isolation: Directed .tsbuildinfo and emitted type declarations to node_modules/.tmp/ to avoid dirtying the git working directory, and added *.tsbuildinfo to .gitignore.

3. Storage Resilience & Atomicity (FsProjectRepository)

  • Atomic Writes: FsProjectRepository::save now writes to a <id>.json.tmp file before atomically moving it to <id>.json via fs::rename. This protects against data corruption in the event of an unexpected process exit or system crash.
  • Resilient Listing: FsProjectRepository::list now handles corrupted JSON files and invalid directory entries gracefully by logging a warning and continuing, preventing a single malformed file from emptying the user's project list.
  • Optimized Deserialization: Utilized serde::de::IgnoredAny within a dedicated ProjectListEntry projection to avoid parsing and allocating full folder/terminal hierarchies during list operations.

4. Structural Validations (model::validation)

  • Stricter Validation Rules: Added ValidationError::EmptyFolderName and ValidationError::EmptyTerminalLabel to reject blank names and labels prior to persistence.

5. CI / Release Workflow

  • Tauri v2 Compatibility: Updated tauri-apps/tauri-action from @v1 to @v2 in .github/workflows/release.yml.

Verification & Testing

All validation suites pass locally with zero errors or warnings:

cargo fmt --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace # 35 unit tests + 3 integration tests passing
npm run build          # tsc -b && vite build

@EduTiyo
EduTiyo merged commit 654e0fd into main Sep 20, 2026
1 check passed
@EduTiyo
EduTiyo deleted the fix/critical-bugs branch September 20, 2026 18:04
@EduTiyo EduTiyo self-assigned this Sep 20, 2026
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