Tunglies
924e7d1022
Refactor string handling to use into() instead of to_string() for improved performance and consistency across the codebase. This change affects various modules including app.rs, clash.rs, config.rs, core.rs, service.rs, and others, ensuring that string conversions are streamlined and more idiomatic.
2025-10-14 09:26:20 +08:00
Sline
b0decf824e
fix(webdav/app): reset client on errors and improve app restart ( #4941 )
...
* fix(webdav/app): reset client on errors and improve app restart
* refactor: rm unused function
2025-10-06 16:54:35 +08:00
Tunglies
3939741a06
refactor: migrate from serde_yaml to serde_yaml_ng for improved YAML handling ( #4568 )
...
* refactor: migrate from serde_yaml to serde_yaml_ng for improved YAML handling
* refactor: format code for better readability in DNS configuration
2025-08-30 02:24:47 +08:00
Tunglies
355a18e5eb
refactor(async): migrate from sync-blocking async execution to true async with unified AsyncHandler::spawn ( #4502 )
...
* feat: replace all tokio::spawn with unified AsyncHandler::spawn
- 🚀 Core Improvements:
* Replace all tokio::spawn calls with AsyncHandler::spawn for unified Tauri async task management
* Prioritize converting sync functions to async functions to reduce spawn usage
* Use .await directly in async contexts instead of spawn
- 🔧 Major Changes:
* core/hotkey.rs: Use AsyncHandler::spawn for hotkey callback functions
* module/lightweight.rs: Async lightweight mode switching
* feat/window.rs: Convert window operation functions to async, use .await internally
* feat/proxy.rs, feat/clash.rs: Async proxy and mode switching functions
* lib.rs: Window focus handling with AsyncHandler::spawn
* core/tray/mod.rs: Complete async tray event handling
- ✨ Technical Advantages:
* Unified task tracking and debugging capabilities (via tokio-trace feature)
* Better error handling and task management
* Consistency with Tauri runtime
* Reduced async boundaries for better performance
- 🧪 Verification:
* Compilation successful with 0 errors, 0 warnings
* Maintains complete original functionality
* Optimized async execution flow
* feat: complete tokio fs migration and replace tokio::spawn with AsyncHandler
🚀 Major achievements:
- Migrate 8 core modules from std::fs to tokio::fs
- Create 6 Send-safe wrapper functions using spawn_blocking pattern
- Replace all tokio::spawn calls with AsyncHandler::spawn for unified async task management
- Solve all 19 Send trait compilation errors through innovative spawn_blocking architecture
🔧 Core changes:
- config/profiles.rs: Add profiles_*_safe functions to handle Send trait constraints
- cmd/profile.rs: Update all Tauri commands to use Send-safe operations
- config/prfitem.rs: Replace append_item calls with profiles_append_item_safe
- utils/help.rs: Convert YAML operations to async (read_yaml, save_yaml)
- Multiple modules: Replace tokio::task::spawn_blocking with AsyncHandler::spawn_blocking
✅ Technical innovations:
- spawn_blocking wrapper pattern resolves parking_lot RwLock Send trait conflicts
- Maintain parking_lot performance while achieving Tauri async command compatibility
- Preserve backwards compatibility with gradual migration strategy
🎯 Results:
- Zero compilation errors
- Zero warnings
- All async file operations working correctly
- Complete Send trait compliance for Tauri commands
* feat: refactor app handle and command functions to use async/await for improved performance
* feat: update async handling in profiles and logging functions for improved error handling and performance
* fix: update TRACE_MINI_SIZE constant to improve task logging threshold
* fix(windows): convert service management functions to async for improved performance
* fix: convert service management functions to async for improved responsiveness
* fix(ubuntu): convert install and reinstall service functions to async for improved performance
* fix(linux): convert uninstall_service function to async for improved performance
* fix: convert uninstall_service call to async for improved performance
* fix: convert file and directory creation calls to async for improved performance
* fix: convert hotkey functions to async for improved responsiveness
* chore: update UPDATELOG.md for v2.4.1 with major improvements and performance optimizations
2025-08-26 01:49:51 +08:00
Tunglies
537d27d10b
fix: clippy errors with new config ( #4428 )
...
* refactor: improve code quality with clippy fixes and standardized logging
- Replace dangerous unwrap()/expect() calls with proper error handling
- Standardize logging from log:: to logging\! macro with Type:: classifications
- Fix app handle panics with graceful fallback patterns
- Improve error resilience across 35+ modules without breaking functionality
- Reduce clippy warnings from 300+ to 0 in main library code
* chore: update Cargo.toml configuration
* refactor: resolve all clippy warnings
- Fix Arc clone warnings using explicit Arc::clone syntax across 9 files
- Add #[allow(clippy::expect_used)] to test functions for appropriate expect usage
- Remove no-effect statements from debug code cleanup
- Apply clippy auto-fixes for dbg\! macro removals and path statements
- Achieve zero clippy warnings on all targets with -D warnings flag
* chore: update Cargo.toml clippy configuration
* refactor: simplify macOS job configuration and improve caching
* refactor: remove unnecessary async/await from service and proxy functions
* refactor: streamline pnpm installation in CI configuration
* refactor: simplify error handling and remove unnecessary else statements
* refactor: replace async/await with synchronous locks for core management
* refactor: add workflow_dispatch trigger to clippy job
* refactor: convert async functions to synchronous for service management
* refactor: convert async functions to synchronous for UWP tool invocation
* fix: change wrong logging
* refactor: convert proxy restoration functions to async
* Revert "refactor: convert proxy restoration functions to async"
This reverts commit b82f5d250b .
* refactor: update proxy restoration functions to return Result types
* fix: handle errors during proxy restoration and update async function signatures
* fix: handle errors during proxy restoration and update async function signatures
* refactor: update restore_pac_proxy and restore_sys_proxy functions to async
* fix: convert restore_pac_proxy and restore_sys_proxy functions to async
* fix: await restore_sys_proxy calls in proxy restoration logic
* fix: suppress clippy warnings for unused async functions in proxy restoration
* fix: suppress clippy warnings for unused async functions in proxy restoration
2025-08-18 02:02:25 +08:00
Tunglies
764ef48fd1
refactor(Draft): Replace latest() with latest_ref() and data() with data_mut() in multiple files for improved mutability handling and consistency across the codebase ( #3987 )
...
* feat: add benchmarking for draft operations and new draft management structure
* Refactor Config Access: Replace `latest()` with `latest_ref()` and `data()` with `data_mut()` in multiple files for improved mutability handling and consistency across the codebase.
* refactor: remove DraftNew implementation and related benchmarks for cleaner codebase
2025-07-04 22:43:23 +08:00
Tunglies
a574ced428
Refactor logging statements to use the new formatting syntax for improved readability and consistency across the codebase. This includes updating error, warning, and info logs in various modules such as system commands, configuration, core functionalities, and utilities. Additionally, minor adjustments were made to string formatting in backup and proxy features to enhance clarity.
2025-06-27 23:30:59 +08:00
Tunglies
53a46d0dc6
refactor: simplify proxy type handling and improve error handling in network commands
2025-05-16 00:09:47 +08:00
wonfen
2622cc06eb
feat: enhance Webdav backup directory check and file upload retry mechanism
2025-04-23 01:10:01 +08:00
wonfen
16846aefd3
feat: allow webdav directory redirect
2025-04-23 00:42:57 +08:00
wonfen
babc2c8f9b
feat: add UA to webdav
2025-04-23 00:29:29 +08:00
Tunglies
b57c6e408a
chore: git hooks for linter and formatter
2025-03-13 12:51:20 +08:00
huzibaca
04d766884a
fix: syntax issues
2024-12-31 04:50:12 +08:00
huzibaca
b658ce7e75
refactor: backup implementation
...
1. timeouts can be set for different operations
2. performance optimization
2024-11-27 07:34:34 +08:00
huzibaca
1b80ddf1e9
chore: timeout adjusted to 15 seconds
2024-11-26 15:09:58 +08:00
huzibaca
a610a43db0
chore: set the request timeout to 3 seconds
2024-11-23 06:50:28 +08:00
huzibaca
44db98f260
chore: set the request timeout to 5 seconds
2024-11-22 14:15:31 +08:00
huzibaca
ae181f6835
fix: webdav list interface compatibility issue
2024-11-17 23:57:28 +08:00
huzibaca
3073b4e48e
chore: unified code format
2024-11-14 03:21:18 +08:00
huzibaca
7b53752ccd
fix: call parameter error
2024-11-14 03:16:32 +08:00
huzibaca
b5e0374946
feat: add webdav backup
2024-11-12 02:55:02 +08:00
huzibaca
c22e4e5e2c
chore: update
2024-11-08 21:46:15 +08:00