[PR #769] [CLOSED] refactor(backup): replace system zip/unzip with pure Rust implementation #779

Closed
opened 2026-03-02 03:41:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/codexu/note-gen/pull/769
Author: @NitronPlus
Created: 11/12/2025
Status: Closed

Base: devHead: zip-crate


📝 Commits (1)

  • e843155 refactor(backup): replace system zip/unzip with pure Rust implementation

📊 Changes

2 files changed (+519 additions, -81 deletions)

View changed files

📝 src-tauri/Cargo.toml (+5 -0)
📝 src-tauri/src/backup.rs (+514 -81)

📄 Description

Replace system-dependent zip/unzip commands with the zip crate for cross-platform compatibility and better error handling.

Fix two bugs when restore backup files

  • Fix restore failure due to not filtering out -wal/-shm files during backup recovery
  • Fix improper cleanup of temp_import directory on restore failure, preventing nested temp_import directories in subsequent backups

I also write three unit test in backup.rs, it will import tempfile crates in dev-dependencies. And use walkdir crate to rewrite copy_dir_recursive function .If you prefer the previous version , I will change it and file a new PR

Adding zip and walkdir crates will increase the final binary size by approximately 1MB on Windows


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/codexu/note-gen/pull/769 **Author:** [@NitronPlus](https://github.com/NitronPlus) **Created:** 11/12/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `zip-crate` --- ### 📝 Commits (1) - [`e843155`](https://github.com/codexu/note-gen/commit/e84315524d0bb32828edb0561bc745ce1659acce) refactor(backup): replace system zip/unzip with pure Rust implementation ### 📊 Changes **2 files changed** (+519 additions, -81 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/Cargo.toml` (+5 -0) 📝 `src-tauri/src/backup.rs` (+514 -81) </details> ### 📄 Description Replace system-dependent zip/unzip commands with the `zip` crate for cross-platform compatibility and better error handling. Fix two bugs when restore backup files * Fix restore failure due to not filtering out -wal/-shm files during backup recovery * Fix improper cleanup of temp_import directory on restore failure, preventing nested temp_import directories in subsequent backups I also write three unit test in backup.rs, it will import tempfile crates in dev-dependencies. And use walkdir crate to rewrite copy_dir_recursive function .If you prefer the previous version , I will change it and file a new PR Adding zip and walkdir crates will increase the final binary size by approximately 1MB on Windows --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 03:41:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/note-gen#779
No description provided.