Skip to content

Refactor/audit 2026 05 - #1

Merged
yaniswav merged 2 commits into
mainfrom
refactor/audit-2026-05
May 15, 2026
Merged

Refactor/audit 2026 05#1
yaniswav merged 2 commits into
mainfrom
refactor/audit-2026-05

Conversation

@yaniswav

Copy link
Copy Markdown
Owner

Description

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • 🧪 Test update

Changes Made

Screenshots (if applicable)

Testing Performed

  • Tested on Windows
  • Tested with ZIP archives
  • Tested with RAR archives
  • Tested with 7z archives
  • Tested with nested archives

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • npm run check passes
  • cargo check passes
  • cargo test passes (if applicable)

Additional Notes

yaniswav added 2 commits May 15, 2026 13:17
Bundles 9 audit-driven lots developed together:
- perf(db): batch INSERT/DELETE in collection product operations
- refactor(commands/products): with_locked_db helper
- perf(maintenance): avoid clones in scan loops
- feat(extractor/batch): eta_seconds calculation
- test(commands/products,orphan_scanner,extractor/{normalize,recursive}): destructive-path coverage
- refactor: tighten error and lock conventions

Tests: 92 → 112 passing.
Copilot AI review requested due to automatic review settings May 15, 2026 12:03
@yaniswav
yaniswav merged commit 16e1d4c into main May 15, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

A large refactor/audit pass on the Rust Tauri backend, primarily applying Clippy lints, replacing deprecated std::io::Error::new(ErrorKind::Other, ...) with Error::other, extracting helpers, and adding unit tests for previously untested destructive paths (orphan scanner, normalize, recursive extractor, product uninstall).

Changes:

  • Mechanical cleanups: clamp, is_none_or, into_owned, sort_by_key, deprecation fixes, combined if let chains, #[allow(dead_code)] annotations on intentionally-public-but-unused API surface, Default impls.
  • Behavior-touching refactors: chunked batched INSERT/DELETE in Database::add_products_to_collection/remove_products_from_collection to stay under SQLite's host-parameter limit; ETA computation in RobustBatchProcessor; extraction of perform_file_uninstall + new with_locked_db helper in commands/products.rs; reordered DAZ-reference extraction in duf_parser::walk_json (semantically equivalent).
  • Substantial new unit-test coverage: orphan_scanner, normalize (incl. destructive extract_archives_parallel), recursive (depth guard + corrupt-zip error path), commands/products (uninstall stats/dry-run/dir-pruning).

Reviewed changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.gitignore Ignore CLAUDE.md
src-tauri/src/error.rs #[allow(dead_code)] on InvalidArchive variant
src-tauri/src/db/{mod,models,product_files,import_tasks,repository}.rs dead-code allows; chunked batched collection insert/delete
src-tauri/src/core/watcher.rs Default impl for WatcherState, dead-code on Modified variant
src-tauri/src/core/trash.rs io::Error::other migration
src-tauri/src/core/thumbnails.rs Combined if/is_none_or
src-tauri/src/core/scene_analyzer.rs Drop unused debug import
src-tauri/src/core/orphan_scanner.rs is_multiple_of; large new tests for resolve_product_identity
src-tauri/src/core/manifest.rs dead-code on action field
src-tauri/src/core/maintenance.rs Borrow-vs-move cleanups, sort_by_key
src-tauri/src/core/extractor/* Clippy cleanups, deprecation fixes, new tests for normalize/recursive, type alias BatchProcessOutcome, ETA in batch progress, _root rename in anchors
src-tauri/src/core/duf_parser.rs Merged extraction branches
src-tauri/src/core/downloader/{mod,http,mediafire}.rs Deprecation/redundant-closure cleanups, dropped unused CHUNK_SIZE
src-tauri/src/core/destination.rs Derive Default instead of manual impl
src-tauri/src/core/catalog.rs is_none_or, drop unused AppError import
src-tauri/src/commands/{archive,bundles,import_tasks,products,watcher}.rs Default impls, with_locked_db helper, extracted perform_file_uninstall + new tests, clippy::too_many_arguments annotations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yaniswav
yaniswav deleted the refactor/audit-2026-05 branch May 19, 2026 17:08
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.

2 participants